Text How To

By admin, March 11, 2010 9:57 am

How can you edit a textbox in visual basic so that it cannot receive text from the keyboard?

I’m making a calculator and using a textbox for the input and output values. I’m also using buttons for the input characters and want to make the textbox so that it cannot be typed in by the keyboard. I’ve tried making it read only but that makes the texbox dim out. Any suggestions???

Use the code below. It tells the system that the event of a keypress has already been handled and doesn’t pass the key press message to the underlying control, preventing any characters appearing.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

e.Handled = True

End Sub

Have fun

How To Make 3D Text In Adobe Photoshop CS3/CS4


Comments are closed

Panorama Theme by Themocracy