Results 1 to 6 of 6

Thread: me.

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    me.

    when you type me.width you are reffering to the form, no matter what control/procedure you put it in.

    Is there something similar for the current procedure. ?

    like when a label is clicked, I want it to say "hi", and if I have over 100 labels on the form... it will take a while to code.

    thanks

    dimava

    By the way: that was just an example
    NXSupport - Your one-stop source for computer help

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    I assume the labels are in an array?
    Code:
    Private Sub Label1_Click(Index As Integer)
    Dim intX As Integer
    Label1(intX).Caption = "Hi"
    End Sub
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    no array, I'm just wondering if there is a thing such as me.caption for the current control
    NXSupport - Your one-stop source for computer help

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    No, Me reffers to the current form.
    Stick a label on a form. In the labels click event procedure type:
    Me.Caption = "Hi"

    The Form's caption changes to Hi, not the label.
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  5. #5
    Matthew Gates
    Guest
    Don't know if you can do it with a label, but other controls that can be set to have the focus, than you can use something like this:


    Code:
    Private Sub Command1_Click()
        Me.ActiveControl.Caption = "Hello World"
    End Sub

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    thanks matt, I guess thats kinda what I was looking for, but it doesn't work with labels
    NXSupport - Your one-stop source for computer help

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