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***

Friday, October 9, 2009

Passing Dynamic Values From One Form to Another in C#

---------------------------------------
//write this code in form1
private void btnPassValue_Click(object sender, EventArgs e)
{
   frmSecondForm myForm2 = new frmSecondForm();
   myForm2.form1TextBoxValue = this.txtPassValue.Text;
   myForm2.Show();
}
------------------------------------------
//write this code in form 2

//form level
private string tempvalue;
public string form1TextBoxValue
{
    get
    {
       return tempvalue;
    }
    set
    {
       tempvalue = value;
    }
}
private void frmSecondForm_Load(object sender, EventArgs e)
{
    this.txtReceiveValue.Text = tempvalue;
}
------------------------------------------
***end of program***

Generating Random Number in C#


//form level declaration
Random random = new Random();
-----------------------------------------------------------------

private void btnRandom1_Click(object sender, EventArgs e)
{    //returns a random number
   int num1 = random.Next();
   this.txtRandom1.Text = num1.ToString();
}
-----------------------------------------------------------------
private void btnRandom2_Click(object sender, EventArgs e)
{   //returns a number less than 1000
   int num2 = random.Next(1000);
   this.txtRandom2.Text = num2.ToString();
}
-----------------------------------------------------------------
private void btnRandom3_Click(object sender, EventArgs e)
{   //returns a number between 1 to 10
   int num3 = random.Next(1,10);
   this.txtRandom3.Text = num3.ToString();
}
-----------------------------------------------------------------
*** end of program ***

Wednesday, October 7, 2009

Light Writing Photography

in a recent episode of talentadong pinoy, light writing photography was featured and i have found it very interesting. here are some facts:

B
y sequencing stills taken with 4-30 second exposure as lights are moved in and through the frame this effect creates the optical illusion that the light is moving. Zooms, pans, tilts, and most other motion camera techniques can be applied with standard stop motion approaches. The most common technique is to capture multiple second exposures of light moving from one point to another in the frame. As the sequence is built the beginning and ending points of the lights motion can be moved along a given path. When the pictures are put in sequence the light seems to move with classic stop motion jitter. Most commonly, all of the work is done in camera at practical (real world, not a studio) locations. (read more on wikipedia)

I have found these photos & video after googling light writing. check them out! ^_^








sprint commercial also seen at david airey's blog