CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 6 FirstFirst 12345 ... LastLast
Results 16 to 30 of 81
  1. #16
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Problem with module and form load slow

    Because nobody else would type 30000 lines rather than 10.

    Code:
     If Val(Options1.Textbox.Text) >= 32 Then
                Testbox.ShowDialog()
    End If
    You enter 33 into the textbox, which IS greater than 32, so you get the message. That is what you wanted?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  2. #17
    Join Date
    Aug 2007
    Posts
    448

    Re: Problem with module and form load slow

    Yes but the main problem is when I type 33 on the textbox, it should be displaying the messagebox but I have received an error:


    Value of '65' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.



    The maximum number is only 32 for trackbar, I wanted the textbox to check if I go over the limit numbers of value on trackbar and display straight away if I go over the limit numbers??



    Hope you can help.


    Thanks,
    Mark

  3. #18
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Problem with module and form load slow

    Did you mark the textbox to be VALIDATE(d)? It won't let you exit with the wrong numbers? That's where you need to change the message, if you don't like it.

    Usually validation is all that's required. They won't be able to enter anything higher than Maximum
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #19
    Join Date
    Aug 2007
    Posts
    448

    Re: Problem with module and form load slow

    No I haven't, so how I can change the textbox to be validate??





    Thanks,
    Mark

  5. #20
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Problem with module and form load slow

    search for that exact error message to find where it's being called.

    where did you get the textbox code? it must have a validate event somewhere.

    again, search for it.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #21
    Join Date
    Apr 2008
    Posts
    82

    Re: Problem with module and form load slow

    Last edited by Oblio; April 21st, 2008 at 09:12 AM.

  7. #22
    Join Date
    Apr 2008
    Posts
    82

    Re: Problem with module and form load slow


  8. #23
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Problem with module and form load slow

    Can you explain what it is your module is meant to be doing (one paragraph will be fine, not 35,000)? If we could understand what you were doing then we can better understand how to help you and reduce the size of that horrendous chunk of code you have there and maybe even teach your a few coding best practices along the way.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

  9. #24
    Join Date
    Aug 2007
    Posts
    448

    Re: Problem with module and form load slow

    @Oblio: Will you please stop posting any spams that I have received from you. Read the forum rules and if you continue to spam then you will be banned. Just post the info to this forum which it much welcome. Simple as that.


    @visualAd: Well on my method they are doing to move the value from 0 to 32 when I type on the textbox so from 33 to any of the highest value I wanted to receive the messagebox when I type the high numbers on the textbox but I have received an error for the same reasons. I tried to use this code but it didn't solve it correctly

    Code:
                If Val(Form2.Textbox.Text = "32") <= 31 Then
                    Form2.TrackBar2.Value = Val(Form2.Textbox.Text)
                ElseIf Val(Form2.Textbox.Text = "33") >= 32 Then
                    Testbox.ShowDialog()
                End If


    I know that the trackbar2 has maximum number up to 32 but I would be happy to ignore the code for controlling when I type the highest value just after 32. Hope you guys can help me out and get this problem right away.


    Thanks,
    Mark

  10. #25
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Problem with module and form load slow

    Quote Originally Posted by mark103
    @Oblio: Will you please stop posting any spams that I have received from you. Read the forum rules and if you continue to spam then you will be banned. Just post the info to this forum which it much welcome. Simple as that.


    @visualAd: Well on my method they are doing to move the value from 0 to 32 when I type on the textbox so from 33 to any of the highest value I wanted to receive the messagebox when I type the high numbers on the textbox but I have received an error for the same reasons. I tried to use this code but it didn't solve it correctly

    Code:
                If Val(Form2.Textbox.Text = "32") <= 31 Then
                    Form2.TrackBar2.Value = Val(Form2.Textbox.Text)
                ElseIf Val(Form2.Textbox.Text = "33") >= 32 Then
                    Testbox.ShowDialog()
                End If


    I know that the trackbar2 has maximum number up to 32 but I would be happy to ignore the code for controlling when I type the highest value just after 32. Hope you guys can help me out and get this problem right away.


    Thanks,
    Mark
    Anyone who uses the Val function needs to be shot. Use the Integer.Parse / Float.Parse functions.

    Now after reading your previous post it looks like you are still describing the problem. We know that you have a problem, however, in order to help you solve the problem we need to understand what you are trying to achieve. Forget about the code you have posted so far (delete it for all I care - just don't post it again ) and tell us what the code is doing. Even better, if it is related to a real world scenario tell us what it is because there is probably already an algorithm out there that works well and even if there is not it will help us to understand.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

  11. #26
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Problem with module and form load slow

    Quote Originally Posted by mark103
    @Oblio: Will you please stop posting any spams that I have received from you. Read the forum rules and if you continue to spam then you will be banned. Just post the info to this forum which it much welcome. Simple as that.
    Leave the hiring and firing to HR and just concentrate on not getting banned from this forum too
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

  12. #27
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452

    Re: Problem with module and form load slow

    Quote Originally Posted by visualAd
    Anyone who uses the Val function needs to be shot. Use the Integer.Parse / Float.Parse functions.
    That's a little harsh. Yes VAL is a vb6 function but it still works in .NET. And yes he should use the .parse or possibly ctype. No need to be rude about it.

    In this code...
    Code:
    If Val(Form2.Textbox.Text = "32") <= 31 Then
            Form2.TrackBar2.Value = Val(Form2.Textbox.Text)
    ElseIf Val(Form2.Textbox.Text = "33") >= 32 Then
            Testbox.ShowDialog()
    End If
    ...I don't think it is doing what you think it is. And I am not sure how the VAL function would do this, however, I think it would be parsed like this.

    Does " Form2.Textbox.Text = "32" " If the answer is yes, take the val of true which would equal 1. If no, take the val of false which should be 0. Either case would then be less than or equal to 31 and you will always try to set the value of the trackbar to whatever the value is in form2.textbox.text. I think what you are looking for is something like this.
    Code:
    If CType(Form2.Textbox.Text, Integer) <= 31 Then
            Form2.TrackBar2.Value = CType(Form2.Textbox.Text,Integer)
    Else
           Testbox.ShowDialog()
    End If

  13. #28
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Problem with module and form load slow

    Quote Originally Posted by sotoasty
    That's a little harsh.....
    Sorry, I should have added a face to the end of that. Yes Val is in VB6 however I would generally stay away from it then, unless you generally do not know the data type of the data which will be entered.

    Anyhow rest assured I did not intend to be rude. May be I should rephrase "using VAL is shooting yourself in the foot"
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

  14. #29
    Join Date
    Apr 2008
    Posts
    82

    Re: Problem with module and form load slow

    Code:
            Dim tbVAL As Integer = 0
            If Integer.TryParse(TextBox1.Text, tbVAL) Then
                If tbVAL >= 0 AndAlso tbVAL <= 32 Then TrackBar1.Value = tbVAL Else TrackBar1.Value = TrackBar1.Maximum
            Else
                MessageBox.Show("Numbers Only Please")
            End If
    @mark, please don't tell me what to do. i posted those links so people would see what they are dealing with. i don't mean this in a mean way, but you need an intro to visual basic programming class.

    e.g. What do you think this means

    If Val(Form2.Textbox.Text = "32") <= 31

    Did you understand the explanation?

    @sotoasty - in one thread at MSDN mark103 told someone they were a f'ing c*nt. i am beginning to believe this is a joke.
    Last edited by Oblio; April 21st, 2008 at 07:29 PM.

  15. #30
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Problem with module and form load slow

    Oblio - turn on your PM's
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Page 2 of 6 FirstFirst 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured