Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to for example if label8 says 0,016% or less* then picture box enable,

Problem is here;

Dim myPercent As Single = Val(Label3.Text) / Val(TextBox1.Text)
       Label8.Text = String.Format("{0:N3}%", myPercent * 100)
       If Label8.Text = "0,016%" Then
           PictureBox6.Visible = True

it show picture box but I want to set up if is "0,016%" or less** then show picture box, but if is value higher than "0,016%" then picture box visible = false... how to?
Posted
Updated 6-Sep-14 4:45am
v2
Comments
[no name] 6-Sep-14 10:46am    
There is a difference between a string and number.

1 solution

Um...why are you comparing strings, and expecting the values to be "greater than" or "less than"?
Why not just use myPercent directly, given that it's a number?
VB
If (myPercent *100) <= 0.016 Then
   ...
 
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