Results 1 to 4 of 4

Thread: Controls without the code :)

  1. #1

    Thread Starter
    Fanatic Member SeaHag's Avatar
    Join Date
    Jul 2001
    Location
    Lake Huron
    Posts
    901

    Controls without the code :)

    Hi

    I have this:

    VB Code:
    1. Private Sub Label2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal y As Single)
    2. Call PopUpMenue(y)
    3. End Sub
    4.  
    5.  
    6. Sub PopUpMenue(y As Single)
    7. Label2.BackColor = &H8000000D
    8. Label2.ForeColor = &H8000000E
    9.  
    10. If y > Label2.Height - 1 Or y < 1 Then
    11. Label2.BackColor = &H8000000F
    12. Label2.ForeColor = &H80000012
    13. End If
    14.  
    15. End Sub


    I want to apply this "function to about 10 labels..
    HOw do I do that without coding each one?


    I am working in excel. And i need a pop up menu.
    So I am coding a frame to mimic a popup menu.

    Any suggestions?

    Seahag

  2. #2
    TheMechanic
    Guest
    You could make the control an Array perhaps

  3. #3

    Thread Starter
    Fanatic Member SeaHag's Avatar
    Join Date
    Jul 2001
    Location
    Lake Huron
    Posts
    901
    Control arrays in VBA.. eeekkk!
    I `ll look at it
    Thanks

  4. #4
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    the objects should be in a collection if they are the only labels on the form or got some other commen attribute others don't have
    the for each statement should do it
    Sanity is a full time job

    Puh das war harter Stoff!

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