Click here to Skip to main content
15,895,606 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Add New Field Pin
MatrixCoder11-Jun-07 17:13
MatrixCoder11-Jun-07 17:13 
GeneralRe: Add New Field Pin
Socheat.Net11-Jun-07 17:26
Socheat.Net11-Jun-07 17:26 
Questionfor next loop [modified] Pin
RoedRunner11-Jun-07 16:45
RoedRunner11-Jun-07 16:45 
AnswerRe: for next loop Pin
MatrixCoder11-Jun-07 17:10
MatrixCoder11-Jun-07 17:10 
GeneralRe: for next loop Pin
RoedRunner11-Jun-07 17:16
RoedRunner11-Jun-07 17:16 
GeneralRe: for next loop Pin
MatrixCoder11-Jun-07 17:18
MatrixCoder11-Jun-07 17:18 
AnswerRe: for next loop Pin
Tirthadip11-Jun-07 19:10
Tirthadip11-Jun-07 19:10 
GeneralRe: for next loop Pin
Duane in Japan12-Jun-07 21:09
Duane in Japan12-Jun-07 21:09 
Do you actually need to loop through the same set of chkboxes, the exact same set each time or is it a random selection?

Private Sub TextBox29_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox29.Validating
Dim Box26 As Double = 0
Dim Box29 As Double = 0
TextBox29.SelectAll()
Dim response As MsgBoxResult
If TextBox29.Text.Length = 0 Then
MsgBox(("A 'B5' value is required." & vbCrLf & _
"Would you like to add more input"), MsgBoxStyle.YesNo)
If response = MsgBoxResult.Yes Then
e.Cancel = True
Else
e.Cancel = False
TextBox28.Text = 0
TextBox31.Text = 0
TextBox32.Focus()
End If
ElseIf Not IsNumeric(TextBox29.Text) Then
MsgBox("This 'B5' value is not numeric.", MsgBoxStyle.Exclamation)
e.Cancel = True
ElseIf CheckBox10.Checked Then
e.Cancel = False
Else
Box26 = CDbl(TextBox26.Text)
Box29 = CDbl(TextBox29.Text)
TextBox27.Text = CStr(Box29 + 1)
TextBox28.Text = CStr(Box26 - Box29)
End If
'If Box29 <= 0 Then
' MsgBox("Your 'B5' value must be greater than zero.", MsgBoxStyle.Exclamation)
' e.Cancel = True
'End If
TextBox35.Clear()
TextBox36.Clear()
TextBox37.Clear()
TextBox38.Clear()
TextBox39.Clear()
End Sub


Notice above:

ElseIf CheckBox10.Checked Then
e.Cancel = False

I have a total of 10 chkboxes and I will check them at complete random depending on the current scenario, and the scenarios are never the same. Later down in the code I just turn off all chkboxes but I could program only certain ones if needed. This is a NOOBs rendition.


Private Sub TextBox39_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox39.Validating
Dim Box35 As Double = (TextBox35.Text)
Dim Box36 As Double = (TextBox36.Text)
Dim Box37 As Double = (TextBox37.Text)
Dim Box38 As Double = (TextBox38.Text)
TextBox39.Text = CStr((Box35 + Box36) + (Box37 - Box38))
If CheckBox1.Checked Then
TextBox4.Text = TextBox39.Text
TextBox8.Focus()
End If
If CheckBox2.Checked Then
TextBox7.Text = TextBox39.Text
TextBox11.Focus()
End If
If CheckBox3.Checked Then
TextBox10.Text = TextBox39.Text
TextBox14.Focus()
End If
If CheckBox4.Checked Then
TextBox13.Text = TextBox39.Text
TextBox17.Focus()
End If
If CheckBox5.Checked Then
TextBox16.Text = TextBox39.Text
TextBox20.Focus()
End If
If CheckBox6.Checked Then
TextBox19.Text = TextBox39.Text
TextBox23.Focus()
End If
If CheckBox7.Checked Then
TextBox22.Text = TextBox39.Text
TextBox26.Focus()
End If
If CheckBox8.Checked Then
TextBox25.Text = TextBox39.Text
TextBox29.Focus()
End If
If CheckBox9.Checked Then
TextBox28.Text = TextBox39.Text
TextBox30.Focus()
End If
If CheckBox10.Checked Then
TextBox31.Text = TextBox39.Text
TextBox32.Focus()
End If
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
CheckBox6.Checked = False
CheckBox7.Checked = False
CheckBox8.Checked = False
CheckBox9.Checked = False
CheckBox10.Checked = False

TextBox35.Visible = False
Label35.Visible = False
TextBox36.Visible = False
Label36.Visible = False
TextBox37.Visible = False
Label37.Visible = False
TextBox38.Visible = False
Label38.Visible = False
TextBox39.Visible = False
Label39.Visible = False
End Sub

I have no naming conventions in my first project here and I am sure there are much better ways of doing my project but its my first attempt with minimal help. YES I unchecked all chkboxes but can code only ones needed at any point in the code blocks. If...Then or If...Then...Else statemants can do your work too to handle different scenarios, of course we do not know exactly what you are working on here.

Remember, I am a NOOB.

Training, http://msdn2.microsoft.com/en-us/library/system.windows.forms.checkbox.checked(VS.80).aspx
AnswerRe: for next loop Pin
Thomas Stockwell12-Jun-07 3:36
professionalThomas Stockwell12-Jun-07 3:36 
QuestionHow to display a new button from Form1 to Form2 Pin
LAPEC11-Jun-07 14:33
LAPEC11-Jun-07 14:33 
AnswerRe: How to display a new button from Form1 to Form2 Pin
nlarson1111-Jun-07 16:25
nlarson1111-Jun-07 16:25 
AnswerIsn't this the same question AGAIN? Pin
leckey12-Jun-07 4:06
leckey12-Jun-07 4:06 
AnswerRe: How to display a new button from Form1 to Form2 Pin
Duane in Japan12-Jun-07 23:42
Duane in Japan12-Jun-07 23:42 
QuestionExecute SSIS package Pin
alexfromto11-Jun-07 11:01
alexfromto11-Jun-07 11:01 
AnswerRe: Execute SSIS package Pin
Sathesh Sakthivel11-Jun-07 15:41
Sathesh Sakthivel11-Jun-07 15:41 
QuestionDisplay .tiff image Pin
Andy Finley11-Jun-07 10:38
Andy Finley11-Jun-07 10:38 
AnswerRe: Display .tiff image Pin
Dave Kreskowiak11-Jun-07 11:11
mveDave Kreskowiak11-Jun-07 11:11 
QuestionRe: Display .tiff image Pin
WYPG280619-Jun-07 6:07
WYPG280619-Jun-07 6:07 
QuestionObject reference error Pin
nickiii11-Jun-07 5:42
nickiii11-Jun-07 5:42 
AnswerRe: Object reference error Pin
Tom John11-Jun-07 5:44
Tom John11-Jun-07 5:44 
GeneralRe: Object reference error Pin
nickiii11-Jun-07 5:48
nickiii11-Jun-07 5:48 
GeneralRe: Object reference error [modified] Pin
Tom John11-Jun-07 6:44
Tom John11-Jun-07 6:44 
AnswerRe: Object reference error Pin
Guffa11-Jun-07 6:36
Guffa11-Jun-07 6:36 
GeneralRe: Object reference error Pin
nickiii11-Jun-07 8:25
nickiii11-Jun-07 8:25 
QuestionInstallers and updating your program Pin
steve_rm11-Jun-07 5:38
steve_rm11-Jun-07 5:38 

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.