I have three labels (label 1, label 2, and label 3), which contain all numeric text values. When a button is clicked, give me a statement if 1 label is larger than label2 and if this happens, then I have to label 3 one up. Here I have the code:
If label1.Text> gt; Label2.Text Then Label3.Text = Label3.Text + 1 End If
I have tested the above code with Label1. The text is getting 100 and Label2.text is 15 but Label3 will never grow; But when I try: '100' will increase if Label2.Text 'or' If Label1.Text> 15 'label3. Am I missing something?
Thanks
Try to convert string value to integer string label 1text Label1 labeled as label1.Text dim labels Label labeled as string label 2text = Label2.Text dim label 2 as idle integer dim label 2 String label 3 text as label 3text = Label3.Text Dim Label 3asNumber as integer as IsNumeric (label1text) then label1asNumber = CInt (label1text) Else label1asNumber = 0 'stop an error harvest If, if IsNumeric (label2text) then label2asNumber = CInt (label2text) other label 2 asNumber = 0 'end of an error end if
then you compare those people:
If label1asNumber & gt; Label2asNumber If IsNumeric (label3text) then label 3asNumber = CInt (label3text) +1 Label3.Text = label3asNumber.To string and ..... 'Your code
No comments:
Post a Comment