Results 1 to 3 of 3

Thread: Pass a Label into a subroutine - [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Location
    Surrey, UK
    Posts
    163

    Pass a Label into a subroutine - [RESOLVED]

    Hi,

    I am trying to make a series of labels change to a colour when you press a button.

    This is what I have written:
    VB Code:
    1. Private Sub CommandButton1_Click()
    2.  
    3.     checkItRed Label1
    4.  
    5. End Sub
    6.  
    7. Sub checkItRed(ObName As Label)
    8.    
    9.     ObName.BackColor = vbRed
    10.     Me.Repaint
    11.  
    12. End Sub


    Basically a label on the form called Label1 and when I click the command1 button I want the label to change to red.

    But I want to have it as a seperate subroutine that needs to be called.


    Can you see what I am doing wrong ? Claims there is a "Type Mismatch"
    Last edited by strobinson1; Oct 25th, 2006 at 09:20 AM.

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