3/30/11

textbox validation only for charachters-WINDOWS

Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress If (Microsoft.VisualBasic.Asc(e.KeyChar) < 65) _ Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 90) _ And (Microsoft.VisualBasic.Asc(e.KeyChar) < 97) _ Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 122) Then If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then e.Handled = True End If End If ' Allowed backspace If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then e.Handled = False End If 'Allowed space End Sub

3/27/11

messagebox in C#

There is no class like System.Windows.Form in C#....... as i want to use messagebox in C# I have added reference as In solution explorer -> right click to website add refenrence -> system.windows.forms check checkbox write in program i.e. default.aspx using system.windows.forms; //add lib use messagebox("Hello");