The character _ means continuation line... just press Enter after _ and continue typing next line of code
Printable View
The character _ means continuation line... just press Enter after _ and continue typing next line of code
I have another question for you.
For each 8 textbox i can enter any number i want.(from 0 to 9)
But how to do that on each textbox i can enter specific number? For example:
Attachment 30427
And i notice a mistake, look at this picture.
Attachment 30429
My C-button clear all textbox and leave them blank.
My code is this:
Code:
Dim intTotal1 As Integer
Dim strTotal1 As String
Dim intTotal2 As Integer
Private Sub Command1_Click()
If IsNumeric(Text1.Text) And _
IsNumeric(Text2.Text) And _
IsNumeric(Text3.Text) And _
IsNumeric(Text4.Text) And _
IsNumeric(Text5.Text) And _
IsNumeric(Text6.Text) And _
IsNumeric(Text7.Text) And _
IsNumeric(Text8.Text) Then
intTotal1 = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text)
strTotal1 = Format(intTotal1, "00")
intTotal2 = Val(Left(strTotal1, 1)) + Val(Right(strTotal1, 1))
Label1.Caption = Format(intTotal2)
Else
MsgBox "Laukelis paliktas tuščias arba įvestas ne skaičius!", vbInformation, "Dėmesio!"
End If
End Sub
Private Sub Command2_Click()
Dim Contrl As Control
For Each Contrl In Form1.Controls
If (TypeOf Contrl Is TextBox) Then Contrl.Text = ""
End Sub
Code:Dim intTotal1 As Integer
Dim strTotal1 As String
Dim intTotal2 As Integer
Dim strTotal2 As String
Private Sub Command1_Click()
If IsNumeric(Text1.Text) And _
IsNumeric(Text2.Text) And _
IsNumeric(Text3.Text) And _
IsNumeric(Text4.Text) And _
IsNumeric(Text5.Text) And _
IsNumeric(Text6.Text) And _
IsNumeric(Text7.Text) And _
IsNumeric(Text8.Text) Then
If Val(Text1.Text) <> 1 And Val(Text1.Text) <> 2 Then
MsgBox "Year must begin with 1 or 2"
Exit Sub
End If
If Val(Text5.Text & Text6.Text) < 1 Or _
Val(Text5.Text & Text6.Text) > 12 Then
MsgBox "Month must be between 01 and 12"
Exit Sub
End If
If Val(Text7.Text & Text8.Text) < 1 Or _
Val(Text7.Text & Text8.Text) > 31 Then
MsgBox "Day must be between 01 and 31"
Exit Sub
End If
intTotal1 = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text)
strTotal1 = Format(intTotal1, "00")
intTotal2 = Val(Left(strTotal1, 1)) + Val(Right(strTotal1, 1))
If intTotal2 > 9 Then
strTotal2 = Format(intTotal2, "00")
intTotal2 = Val(Left(strTotal2, 1)) + Val(Right(strTotal2, 1))
End If
Label1.Caption = Format(intTotal2)
Else
MsgBox "Laukelis paliktas tuščias arba įvestas ne skaičius!", vbInformation, "Dėmesio!"
End If
End Sub
Private Sub Command2_Click()
Dim Contrl As Control
For Each Contrl In Form1.Controls
If (TypeOf Contrl Is TextBox) Then
Contrl.Text = ""
End If
Next
End Sub
add another line of code. that's what _ means
Iy would be better if you start a new thread about transparency in VB6... anyway
Here's a small VB6 project about transparent form
I think this is better than explain here