Click here to Skip to main content
15,904,655 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVB6.0 - Common Dialog "ShowSave" method to get a Folder? Pin
ChemmieBro19-Feb-07 9:55
ChemmieBro19-Feb-07 9:55 
QuestionEncrypted source files Pin
Fernando A. Gomez F.19-Feb-07 8:38
Fernando A. Gomez F.19-Feb-07 8:38 
AnswerRe: Encrypted source files Pin
Dave Kreskowiak19-Feb-07 9:33
mveDave Kreskowiak19-Feb-07 9:33 
GeneralRe: Encrypted source files Pin
Fernando A. Gomez F.19-Feb-07 10:43
Fernando A. Gomez F.19-Feb-07 10:43 
QuestionUseing Serial Port Pin
Max Bayne19-Feb-07 8:13
Max Bayne19-Feb-07 8:13 
AnswerRe: Useing Serial Port Pin
Ankur.Bakliwal19-Feb-07 17:35
Ankur.Bakliwal19-Feb-07 17:35 
Questiondisable groupbox Pin
jds120719-Feb-07 7:56
jds120719-Feb-07 7:56 
AnswerRe: disable groupbox Pin
Marcus J. Smith19-Feb-07 8:19
professionalMarcus J. Smith19-Feb-07 8:19 
AnswerRe: disable groupbox Pin
TwoFaced19-Feb-07 8:23
TwoFaced19-Feb-07 8:23 
QuestionCONVERSION OF VB CODE TO JAVASCRIPT Pin
soadfreak19-Feb-07 7:48
soadfreak19-Feb-07 7:48 
AnswerRe: CONVERSION OF VB CODE TO JAVASCRIPT Pin
Christian Graus19-Feb-07 8:53
protectorChristian Graus19-Feb-07 8:53 
Questionadding new record and saving in VB.NET Pin
7prince19-Feb-07 6:15
7prince19-Feb-07 6:15 
AnswerRe: adding new record and saving in VB.NET Pin
Marcus J. Smith19-Feb-07 8:24
professionalMarcus J. Smith19-Feb-07 8:24 
GeneralRe: adding new record and saving in VB.NET Pin
7prince19-Feb-07 8:46
7prince19-Feb-07 8:46 
AnswerRe: adding new record and saving in VB.NET Pin
Christian Graus19-Feb-07 10:17
protectorChristian Graus19-Feb-07 10:17 
QuestionRetain values in drop down lists between redirects Pin
dasumohan19-Feb-07 5:20
dasumohan19-Feb-07 5:20 
AnswerRe: Retain values in drop down lists between redirects Pin
Marcus J. Smith19-Feb-07 6:55
professionalMarcus J. Smith19-Feb-07 6:55 
QuestionVb.net text box that accepts Caps A-Z Pin
kendo1719-Feb-07 5:09
kendo1719-Feb-07 5:09 
AnswerRe: Vb.net text box that accepts Caps A-Z Pin
Thomas Stockwell19-Feb-07 6:50
professionalThomas Stockwell19-Feb-07 6:50 
AnswerRe: Vb.net text box that accepts Caps A-Z Pin
Marcus J. Smith19-Feb-07 6:53
professionalMarcus J. Smith19-Feb-07 6:53 
AnswerRe: Vb.net text box that accepts Caps A-Z Pin
TwoFaced19-Feb-07 8:49
TwoFaced19-Feb-07 8:49 
Why annoy the user if it's a lowercase letter, just convert it to uppercase for them. The following code will only allow letters and it converts them to uppercase. It also allows backspace, delete etc. If you want to message the user for invalid keys you could add a message here as well. Also as suggested before you may want to create your own control and inherit the textbox class, which will allow you to create a reusable control that has this validation built in. You could also simply add handlers so this routine handles all the textboxes you want validated. One other note, users will still be able paste invalid text into the textbox. You should validate this text in the validate event, or prevent users for pasting by setting the property 'ShortcutsEnabled' to false.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    'If key press isn't control key (backspace...and others?) or a letter then ignore it
    If Not (Char.IsControl(e.KeyChar) OrElse Char.IsLetter(e.KeyChar)) Then e.Handled = True
    'Force capitalized letter
    If Char.IsLetter(e.KeyChar) Then e.KeyChar = Char.ToUpper(e.KeyChar)
End Sub

GeneralRe: Vb.net text box that accepts Caps A-Z Pin
kendo1719-Feb-07 11:00
kendo1719-Feb-07 11:00 
GeneralRe: Vb.net text box that accepts Caps A-Z Pin
TwoFaced19-Feb-07 11:12
TwoFaced19-Feb-07 11:12 
GeneralRe: Vb.net text box that accepts Caps A-Z Pin
kendo1719-Feb-07 23:10
kendo1719-Feb-07 23:10 
GeneralRe: Vb.net text box that accepts Caps A-Z Pin
TwoFaced20-Feb-07 7:23
TwoFaced20-Feb-07 7:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.