Click here to Skip to main content
16,003,462 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: thanks Pin
TwoFaced15-Mar-07 12:27
TwoFaced15-Mar-07 12:27 
GeneralRe: thanks Pin
manni_n15-Mar-07 12:45
manni_n15-Mar-07 12:45 
GeneralRe: thanks Pin
TwoFaced15-Mar-07 12:49
TwoFaced15-Mar-07 12:49 
GeneralRe: thanks Pin
manni_n15-Mar-07 12:55
manni_n15-Mar-07 12:55 
GeneralRe: thanks Pin
TwoFaced15-Mar-07 12:59
TwoFaced15-Mar-07 12:59 
Generalperfect... Pin
manni_n15-Mar-07 13:12
manni_n15-Mar-07 13:12 
Generalcheck it... Pin
manni_n15-Mar-07 13:23
manni_n15-Mar-07 13:23 
GeneralRe: check it... [modified] Pin
TwoFaced15-Mar-07 14:07
TwoFaced15-Mar-07 14:07 
Yup, thats right. I recomend the validation event. Personally I wouldn't validate text in the manner you want as it changes for the very reason you are now experiencing. What you need to do is create a new procedure to handle the validation event. This is the declaration of that procedure.
Private Sub txtBox_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)

End Sub
You should move the validation code into this procedure. Then you'll need to change the addhandler statement. The event should be validating and the part that goes after addressof should be the name of the procedure ie. txtBox_Validating. The validating event fires just before the focus changes. In the validating event you can use e.cancel = true to prevent focus from leaving the textbox. So if the text isn't validated you can display a message and cancel the change of focus.

One more thing. Use this
If not txt Is txtSender AndAlso txt.Text = txtSender.Text AndAlso txt.Text <> "" Then
instead of the current line you have otherwise validation will fail if a textbox is empty because other textbox's are empty. I should have changed that earlier. I forgot to mention it.
GeneralRe: check it... Pin
manni_n16-Mar-07 1:05
manni_n16-Mar-07 1:05 
GeneralRe: check it... Pin
TwoFaced16-Mar-07 6:30
TwoFaced16-Mar-07 6:30 
GeneralRe: check it... Pin
manni_n16-Mar-07 8:34
manni_n16-Mar-07 8:34 
GeneralRe: check it... Pin
TwoFaced16-Mar-07 10:13
TwoFaced16-Mar-07 10:13 
Generalcool... [modified] Pin
manni_n16-Mar-07 11:06
manni_n16-Mar-07 11:06 
GeneralRe: cool... Pin
TwoFaced16-Mar-07 12:11
TwoFaced16-Mar-07 12:11 
QuestionChecked List Box Pin
taherjaorawala14-Mar-07 21:46
taherjaorawala14-Mar-07 21:46 
AnswerRe: Checked List Box Pin
manni_n14-Mar-07 23:13
manni_n14-Mar-07 23:13 
QuestionTyped dataset, insert, return output parameter Pin
steve_rm14-Mar-07 19:38
steve_rm14-Mar-07 19:38 
AnswerRe: Typed dataset, insert, return output parameter Pin
Steven J Jowett15-Mar-07 1:57
Steven J Jowett15-Mar-07 1:57 
QuestionTotal Hours and minutes Pin
Member 387988114-Mar-07 19:03
Member 387988114-Mar-07 19:03 
AnswerRe: Total Hours and minutes Pin
Tirthadip14-Mar-07 23:39
Tirthadip14-Mar-07 23:39 
GeneralRe: Total Hours and minutes Pin
Member 387988114-Mar-07 23:56
Member 387988114-Mar-07 23:56 
GeneralRe: Total Hours and minutes Pin
coolestCoder15-Mar-07 2:25
coolestCoder15-Mar-07 2:25 
GeneralRe: Total Hours and minutes Pin
Member 387988115-Mar-07 0:17
Member 387988115-Mar-07 0:17 
QuestionMaking User Under WinXP/NT/2000 (NT Family) With VB or API Pin
Mogtabam14-Mar-07 18:34
Mogtabam14-Mar-07 18:34 
Questionlittle problem with codes :) Pin
alpdoruk14-Mar-07 13:28
alpdoruk14-Mar-07 13:28 

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.