Copy and paste this into your Form_Initialise code:
Code:Me.Close()
And everything will fix itself. No joke.
Printable View
Copy and paste this into your Form_Initialise code:
Code:Me.Close()
And everything will fix itself. No joke.
this has to be a joke.......... seriously
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
>>> add periods to names <<<
and for the record, we don't 'need' or 'have' to do anything. The problem isn't us.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
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
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:
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.Quote:
Originally Posted by mark103
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.
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
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.Quote:
Originally Posted by mark103
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.
>>> add periods to names <<<
Did you read the line above????????????????
Form2TextboxText becomes Form2.Textbox.Text
Form2TrackBar2Value becomes (you can figure it out, can't you?)
If you change this code using the hints above it will get you started.
and for the record, we don't 'need' or 'have' to do anything. The problem isn't us.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
@Oblio: Your post was the same when I HAVE already tried out using with your code so DO NOT repost with the old same crap again. Your code shows nothing from my code. So now I am going to stick with my code. I am trying to find any situations to get the code successful but I have no luck so far...
I think its best for you guys to read it again what's going on....
When I type the value numbers on textbox and if I type higher than 1.0 which it greater than 1000 for trakbar value, I received the textbox.showdialog which it works great BUT when I try to move the trackbar value to the lower value, I received the textbox.showdialog immediately everytime. I am not over the limit of the strings. And when I type the lowest strings numbers like 9, the textbox.showdialog also display. See the trouble I has....
You guys need to reread on my 55th post carefully as there is NO need to repeat it again, I don't want to say it again, again, again, again and again as it getting on my nervous and I'm getting boring of sayin this again.
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
However, I don't want to write the longest code to make my form slowing down like this.....
Code:If Form2.Textbox.Text = 1.0 Then
Form2.TrackBar2.Value = 1000
Textbox.ShowDialog()
End If
End If
If Form2.Textbox.Text = 2.0 Then
Form2.TrackBar2.Value = 1000
Textbox.ShowDialog()
End If
End If
If Form2.Textbox.Text = 3.0 Then
Form2.TrackBar2.Value = 1000
Textbox.ShowDialog()
End If
End If
If Form2.Textbox.Text = 4.0 Then
Form2.TrackBar2.Value = 1000
Textbox.ShowDialog()
End If
End If
ETC.....
This is why I am HERE to require for some help, because the strings is greater than or equal to the following number but I CANNOT move the trackbar value or type any of the less numbers.
I don't want to write from 1.0 to 10 which is the crazy job to write the longest numbers. To write If Form2.Textbox.Text > 1.0 Then is much quicker than the longest job to write but I am having trouble with the loops.
I need this to get fix asap.
Thanks,
Mark
where would 1.25 go? just for argument's sake
What 1.25 are you talking about???????????
All you had to do was change the names of the variables. I even gave an example of how. I think it was a grand total of 10 "."'s you needed to add.
My 'cr*p' works, how about yours?
You are correct, I didn't do it like you did, but why would I? Stick with your code, no one cares.
In all of your posts, in several forums, you have demonstrated that
1. you need a class in simple programming concepts
2. you are rude
3. you use obscene language which I believe has gotten you banned from several forums (i.e. MSDN, VBForums)
So, good luck finding someone to help you.
I don't like to get personal here, but you are telling us to "read your posts". Yet, you are not reading any of the replies to your posts. I understand that you need help but you need to understand but in order for us to help you, you need to help yourself.Quote:
Originally Posted by mark103
You have been told no less than 6 times what the problem is. You have been old more than ten times that you cannot compare a string to a number i.e If Textbox1.Text > 1.0 and you have completely ignored us.
So if you have indeed read more than the first two words in this post please answer the following questions:
- Why can you not use oblio's code?
- Which part of use Float.Parse or Integer.Parse instead of String > 1.0 do you not understand?
- Are you just waiting for some sucker to come along and post the code for you so all you have to do is copy and paste it?
- What is the code modelling? What real world situation is it mimicking; if any? We may be able to suggest an even faster algorithm than the one you are already using.
If you cannot answer these questions, I see little point sticking around and helping you. I have not reported you for the language you used in your previous posts, so I suggest you remove it before a moderator stumbles upon it and you get ousted from this forum too.
If you work with us you will solve the problem. If you work against us you will get nowhere.
P.s: I think it strange that the quality of English in your posts has reduced significantly since your first post. May I suggest that you cease pretending to be a non-English speaker. :wave:
I'm with visualAd here: either learn to help yourself by actually reading and trying what members has posted, or you can just get banned.
I think this is the same question before that got you banned, and yet you are acting the same as before. Either Mark here needs to take a hint, or us (the ones who are trying to help him, even a small amount) should take a hint and just leave this thread to die.
Sure, it's nice and all trying to help someone, but when it's getting this far and there are no results at all, and bad language is being used by the person starting the thread, it's best just to ignore the OP in this case.
Anyone with me for boycotting this thread?
I think the only way for Mark to get the idea of whats going on with String vs Integer.. is for him to turn on Implicit convertion Error's in the Debug tab of The project window...
Mark.... click on 'My project under the project/Solution explorer on the right ...
Click on the 'Debug' tab ...
and adjust the Condition Notifications as follows..
http://i141.photobucket.com/albums/r...convertion.jpg
Once you resolve the Implicit conversion errors.. you should understand what over half of the posts on this thread are trying to explain to you....
That's about all i'm prepared to add to this thread...
Gremmy...
Quote:
Originally Posted by mark103
If someone can enter 1-999, and 1.0 is special, as is 1.1 (from your example) and your code worked perfectly.
What happens if I enter 1.25 into your textbox? What SHOULD your app do?
My app would popup the message box in order you are typing over the limit. It same for 1.1, I tried to fix it as it works perfectly but the main problem is when I try to move the trackbar value or type the value numbers on textbox, I will receive the textbox.showdialog.
@Gremmy: You didn't come on this thread when I post and required for some help. Did you read on my 62nd post?? I need your help to find the way how we can work together to get my code solve.
I find it hard to fix the problem. That's why I am here to require for some help.
Thanks,
Mark
Quote:
Originally Posted by dglienna
what does moving the trackbar have to do with the textbox? :eek: :sick:
I know I'll regret this but mark103, why does 1.0 = 1000?
However, try this code.
Code:If Form2.Textbox.Text.Contains(".") Then
Form2.TrackBar2.Value = 1000
Textbox.ShowDialog()
Else
Try
Me.TrackBar2.Value = Cint(Form2.Textbox.Text)
Catch ex As Exception
MsgBox("Invalid value.")
End Try
End If
Errrmmmm... CHECK POST #2 AND #8 ..... I think i was the first to offer assistance to you on this thread ..........Quote:
Originally Posted by mark103
So do you see what i'm trying to expain ???????Quote:
Originally Posted by mark103
P.S. You are managing to insult almost all of the senior members who post in the VB6 forum... Some of us have been coding from before you were born, and know what we talking about... Just think about that before you make your next post..
Or, someone might suggest that this thread be locked for wasting our time.
Yes please lock this thread
and shoot the op
jeez, 3 years in VB and you work like that? OMFG!!!!!!!!!!!!
I wonder how you do simple database transactions. They must be horrid.
Yes I do GremlinSA, I understand the way of how to write the method. I got the string correct by writing less than or equal 999 so what about writing 1.0 instead 1000 of trackbar value??
I'm only to use and write the code for my textbox. You said that String to Decimal Comparison is wrong. What is the correct way of writing the string using with greater than 1.0 to receive the textbox.showdialog??
I'm sorry for being insulting to guru members but something that give me frustrating on the hard job I have ever deals with so your advise would get my job done without being frustrating.
Thanks,
Mark
Quote:
Originally Posted by mark103
Code:Double.Parse(stringHere)
' OR
Single.Parse(stringHere)
Holy crap this guy must be related to that girl in the other thread. Mark I take it English is not your first language?
Anyway, I just started to learn Visual Basic myself, but I am blown away that you are unable to grasp something so simple after coding in it for 3 years? I sat down this morning and wrote a whole program and all I did was read a book.
There is no need to shout, argument or be rude with each other. I have decided to upload the following attachment which it would save me a time around by having alot of trouble. You can see what goes wrong. The trackbar value are working fine if I type 1.0 on the textbox or empty the textbox and I move the value then I have no problem. Used to be received the message box when I moved the value so I am glad that I have fixed the problem.
When I removed the text on the textbox, the trackbar value moved to 0 and when I type 1.0, the trackbar value moved to 1000. When I type higher than 1.4, I received the message box which it works GREAT! But I cannot type any of the lowest numbers like 2,3,4,5,6,7,8......etc because the message box will appear. I can only type an empty textbox and 1.0. How can I get pass of the loops which it will allows me to type any of the lowest numbers and if I type higher than 1.0 then the message box will appears to come up on the screen??
Thanks,
Mark
You have something wrong here:
1.x IS LOWER than 2, not HIGHER. 2 cannot be a LOWEST NUMBERQuote:
higher than 1.4, I received the message box which it works GREAT! But I cannot type any of the lowest numbers like 2,3,4,5,6,7,8....
OK guys, I've had enough. Here I draw the line.
I've decided to close this thread, because there were too many insults to one another.
We are all here to help and to learn, if we cannot do that in a civilised manner, then I don't know anymore.
Mark, please start a new thread, but concider the fact that good advice was given all the way through this thread. You cannot expect us to do your job for you - that is what you get paid to do. Make an effort, from your side too, else, by being spoon fed all the time, will benefit you nothing.
Others, please, don't get too insulting again.