Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Private Sub Command1_Click()
Dim b As Integer, a1, a2 As Integer
Dim c As Integer
'****************************
For b = 0 To 2
  If Check1(b).Value = 1 Then
     c = c + Check1(b)
  End If
 Next
'***************************
For b = 0 To 2

If c >= 2 Then
If Check1(b).Index = 0 Then
a1 = 59
ElseIf Check1(b).Index = 1 Then
a1 = 60
ElseIf Check1(b).Index = 2 Then
a1 = 61
Else
End If
'***************************************
If Check1(b).Value = 1 Then
Dim strText() As String
ReDim Preserve strText(0 To c) As String
     MsgBox c
    For i = 0 To c
         strText(i) = Check1(b).Caption
         Text1.Text = strText(i) & "+" & a1
      Next i
  Else
End If
'******************************************
ElseIf c < 2 Then
'******************************************
If Check1(b).Index = 0 Then
   a2 = 59
ElseIf Check1(b).Index = 1 Then
   a2 = 60
ElseIf Check1(b).Index = 2 Then
   a2 = 61
 Else
End If
'******************************************
If Check1(b).Value = 1 Then
ReDim Preserve strText(0 To c) As String
For i = 0 To c
    strText(i) = Check1(b).Caption
    Text1.Text = strText(i) & "+" & a2
    Next i
   Else
  End If
 End If
Next
'*********************************************
End Sub

like "text1.text=A+B" to juxtapose
Posted
Comments
Sergey Alexandrovich Kryukov 28-Feb-13 2:01am    
Not a question. Does not seem to make any sense.
—SA
Kenan YILMAZ 28-Feb-13 7:39am    
Here strText (i) Taught values ​​I want to come together in text1
Kenan YILMAZ 28-Feb-13 7:41am    
Here strText (i) Taught want to come together in a string text1 values
Orcun Iyigun 28-Feb-13 2:11am    
First check this link (Code Project Quick Answers FAQ[^]) and try asking again!
Kenan YILMAZ 28-Feb-13 7:39am    
Here strText (i) Taught values ​​I want to come together in text1

1 solution

That looks correct (except the double quotes)
If working with numbers and you want to add, you use the +
If you want to concatenate two strings, use &

text1.text = A + B ' A=1, B=2, Text1.text will display 3
text1.text = A & B ' A=1, B=2, Text1.text will display 12
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900