Re: Problem with module and form load slow
Nearly done guys, I'd find it difficult with this task. When I type the numbers so far it works ok but when I try to move the lowest trackbar value numbers like 999, Testbox.Showdialog() appears to come up everytime.
Here it the code:
Code:
If Val(Form2.Textbox.Text) <= 999 Then
Form2.TrackBar2.Value = Val(Form2.Textbox.Text)
End If
If Form2.Textbox.Text = "1.0" Then
Form2.TrackBar2.Value = 1000
End If
If Form2.Textbox.Text > "1.0" Then
Form2.TrackBar2.Value = 1000
Textbox.ShowDialog()
End If
End If
Please can you tell me how I can fix that?? I don't want to remove Testbox.Showdialog() or anything. I just want to go over the limit of 1.0 in order to show Testbox.Showdialog.
Thanks,
Mark
Re: Problem with module and form load slow
Not until you READ THE OTHER POSTS
Re: Problem with module and form load slow
See my post on above, I'm having trouble. Nothing to do with old post.
Re: Problem with module and form load slow
Quote:
Originally Posted by dglienna
If you call this 3 years of VB, you should give up. You cannot compare a STRING to a NUMBER, and when you say "1000" that is NOT the same as 1000.
"1000" is a STRING
1000 is a NUMBER
VAL("1000") turns it INTO a NUMBER (if it was one)
VAL("X") = 0 (because "X" is not a number)
Don't read old posts? :eek: :sick: :lol:
Help yourself, or ignore the help
Re: Problem with module and form load slow
Quote:
Originally Posted by mark103
See my post on above, I'm having trouble. Nothing to do with old post.
Yes, I see exactly what your trouble is. You are lazy .... unfortunately the only person who can solve that problem is you.
Show some evidence of being able to grasp the simple concepts of VB and maybe we will be more willing to help. So far, you have failed to explain the problem adequately and you have failed to take on any advice anyone here has given you unless it has been copy and pastable.
Re: Problem with module and form load slow
Copy and paste this into your Form_Initialise code:
And everything will fix itself. No joke.
Re: Problem with module and form load slow
this has to be a joke.......... seriously
Re: Problem with module and form load slow
I HAVE already explained what the problem is! When I type the numbers from 0 to 999, it working ok so far using with this code:
Code:
If Val(Form2.Textbox.Text) <= 999 Then
Form2.TrackBar2.Value = Val(Form2.Textbox.Text)
End If
If Form2.Textbox.Text = "1.0" Then
Form2.TrackBar2.Value = 1000
End If
BUT if I add the code from below to work together with the code on above and if I try to move the trackbar value numbers like 999, testbox.Showdialog() appears to come up everytime.
Code:
If Form2.Textbox.Text > "1.0" Then
Form2.TrackBar2.Value = 1000
Textbox.ShowDialog()
End If
End If
You need to read on my previous post what I have already explained. I don't want to say it again when someone like visualAd who are very lazy enough to not read my post.
Plz help me guys, I am having trouble of trying to fix the method but I am nowhere nearby!!!!!!
Thanks,
Mark
Quote:
Originally Posted by visualAd
Yes, I see exactly what your trouble is. You are lazy .... unfortunately the only person who can solve that problem is you.
Show some evidence of being able to grasp the simple concepts of VB and maybe we will be more willing to help. So far, you have failed to explain the problem adequately and you have failed to take on any advice anyone here has given you unless it has been copy and pastable.
Re: Problem with module and form load slow
>>> add periods to names <<<
Code:
Private Sub setTrackBar()
If Not IsNumeric(Form2TextboxText) Then
'textbox is not number
Debug.WriteLine("NOT A NUMBER")
Exit Sub
End If
Dim asDecimal As Decimal = Decimal.Parse(Form2TextboxText)
Dim asInteger As Integer = Convert.ToInt32(Math.Ceiling(asDecimal))
Select Case Form2TextboxText 'textbox is string
Case "1.0" 'this is string
Form2TrackBar2Value = 1000
Case Else
If asInteger > 0 AndAlso asInteger <= 999 Then
Form2TrackBar2Value = asInteger
Else
Debug.WriteLine("number not between 1 and 999 inclusive")
End If
End Select
End Sub
and for the record, we don't 'need' or 'have' to do anything. The problem isn't us.
Re: Problem with module and form load slow
Your code shows nothing from my code. When I type the trackbar value numbers on textbox and if I type higher than 1.0 which it 1000 for trakbar value then I want the textbox.showdialog to display immediately. It works from my following code but I cant move the trackbar value due to receive textbox.showdialog displayin immediately everytime if I try to move the trackbar value.
Code:
If Form2.Textbox.Text > 1.0 Then
Textbox.ShowDialog()
End If
You should read more as I am having trouble of trying to make the textbox.showdialog to show up if I type over 1.0 on the textbox like 1.1, 2.1......etc
I hope you understands of the trouble I have received so far I have no luck of being successful.....
Hope you guys will help me out using with my code to rewrite and get the problem fixing.
Thanks,
Mark
Re: Problem with module and form load slow
Then tell your professor that it cannot be done because the computer doesn't know that 1.1 is supposed to mean 1000 and so is everything above 1.2, except if the number is LESS THAN 1000. :sick:
Re: Problem with module and form load slow
Quote:
Originally Posted by mark103
When I type the trackbar value numbers on textbox and if I type higher than 1.0 which it 1000 for trakbar value then I want the textbox.showdialog to display immediately. It works from my following code but I cant move the trackbar value due to receive textbox.showdialog displayin immediately everytime if I try to move the trackbar value.
If that's the case, create a Label, give it a rememberable name (e.g. Mark103), and change it so instead of doing ShowDialog, it will output something like "Yes" on the Label. Then once you've sorted out which value you want to make the ShowDialog appear, use an if statement so that it should equal a value.
Tip: Convert String to Integer. Use Val(), use anything you're familiar with now, just so you can convert to int and do proper comparisons on numbers.
Next time I won't be this helpful.
Re: Problem with module and form load slow
and to be real helpful, read this part:
Tip: Convert String to Integer. Use Val(), use anything you're familiar with now, just so you can convert to int and do proper comparisons on numbers.
50 posts to say the same thing. Start learning something on your own
Re: Problem with module and form load slow
I have tried convert string to integer and what happens? Still don't works. It works when I type over the limit of 1.0 but I cannot move the trackbar which I will received testbox.showdialog. That's why I need your help but you didn't post the fixing code or anything else to get my problem resolve ffs :rolleyes:
Re: Problem with module and form load slow
Quote:
Originally Posted by mark103
I have tried convert string to integer and what happens? Still don't works. It works when I type over the limit of 1.0 but I cannot move the trackbar which I will received testbox.showdialog. That's why I need your help but you didn't post the fixing code or anything else to get my problem resolve ffs :rolleyes:
Read post #54.
There is no need for rudeness. So far you have shown little evidence of helping yourself. Oblio has posted some pseudo code which would appear to do exactly what you need in post #54 but all you said was "that is not like my code".
How about looking at the post and converting the code into .NET. If you cannot do that then I suggest you pay someone to fix this problem for you because all we do is help you to help yourself.