CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 4 of 6 FirstFirst 123456 LastLast
Results 46 to 60 of 81
  1. #46
    Join Date
    Aug 2007
    Posts
    448

    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

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

    Re: Problem with module and form load slow

    Not until you READ THE OTHER POSTS
    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!

  3. #48
    Join Date
    Aug 2007
    Posts
    448

    Re: Problem with module and form load slow

    See my post on above, I'm having trouble. Nothing to do with old post.

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

    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?

    Help yourself, or ignore the help
    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!

  5. #50
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    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.
    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.

  6. #51
    Join Date
    Apr 2008
    Posts
    4

    Re: Problem with module and form load slow

    Copy and paste this into your Form_Initialise code:

    Code:
    Me.Close()

    And everything will fix itself. No joke.

  7. #52
    Join Date
    Apr 2008
    Posts
    25

    Re: Problem with module and form load slow

    this has to be a joke.......... seriously

  8. #53
    Join Date
    Aug 2007
    Posts
    448

    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.

  9. #54
    Join Date
    Apr 2008
    Posts
    82

    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.
    Last edited by Oblio; April 25th, 2008 at 03:45 PM.

  10. #55
    Join Date
    Aug 2007
    Posts
    448

    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

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

    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.
    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!

  12. #57
    Join Date
    Apr 2008
    Posts
    4

    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.

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

    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
    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!

  14. #59
    Join Date
    Aug 2007
    Posts
    448

    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

  15. #60
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    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
    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.
    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.

Page 4 of 6 FirstFirst 123456 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