Thursday, October 22, 2009

"jQuery for Absolute Beginners" Video Series

just recently, i've been studying how to use jQuery. a million thanks to my friends tags and botski for the help. ^_^

you can find a video series on jQuery by following this link:
http://blog.themeforest.net/screencasts/jquery-for-absolute-beginners-video-series/

i've just started and working on day 3 video tutorial. ^_^
knowledge on html, css and javascript are needed.

Wednesday, October 14, 2009

KeyPress Event and KeyStrokes

the following code segment demonstrate how to detect keystroke, specifically ENTER key in a textbox keypress event.

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
   if (e.KeyChar == (char)13)
   {
   MessageBox.Show("You pressed the ENTER key.");
   }
}

--------------------------------------------------
to identify decimal equivalent of each keys, try this code:

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
   int x= (int)e.KeyChar;
   MessageBox.Show(x.ToString());
}

--------------------------------------------------
***happy coding***
for more decimal representation of each character visit http://www.asciitable.com/

Tuesday, October 13, 2009

How to Dispose a Form in C# Without Closing the Application

in program.cs file replace the following code

      Application.Run(new Form1());

with, an instance of your start-up form, such as

   Form1 frm1 = new Form1();
   frm1.Show();
   Application.Run();
*** now you can dispose the form without closing the application
-------------------------------------

from time to time, you will be needing these codes:

   Application.Exit(); <- to close the whole application

   frm1.Close(); <- to close your current form window
   frm1.Dispose(); <- to free memory resources, when form is shown modally. ^_^
-------------------------------------
***good luck***