+ Reply to Thread
Results 1 to 7 of 7

How a textbox_enter can change a SpinButton?

Hybrid View

  1. #1
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: How a textbox_enter can change a SpinButton?

    I have following idea:
    - extract your code from _SpinDown, _SpinUp to outside procedure like Sub S_Down, Sub S_Up and then call those procedures in place of your code you need it.

    Best Regards

  2. #2
    Registered User
    Join Date
    01-27-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: How a textbox_enter can change a SpinButton?

    I tried, but I can't solve the problem.

    Now I changed Spinbutton. It doesn't have Private Up or Down, but:

    Private Sub SpinButton1_Change()
        
        If SpinButton1.Value > ListBox1.ListCount Then
            SpinButton1.Value = ListBox1.ListCount
        End If
        
        If ListBox1.ListCount > SpinButton1.Value And SpinButton1.Value >= 0 And SpinButton1.Value <= ListBox1.ListCount Then
            ListBox1.ListIndex = SpinButton1.Value
            Label1.Caption = SpinButton1.Value
        End If
    End Sub

    and
    Private Sub ListBox1_Change()
       (...)
            SpinButton1.Value = ListBox1.ListIndex
            TextBox1.Text = MyArray(ListBox1.ListIndex, 2)
            TextBox1.SetFocus 'I don't know why, but textbox1 just get the focus every two times that I click the spinbutton.
    End Sub
    Last edited by marlonsaveri; 07-19-2011 at 03:48 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1