Results 1 to 5 of 5

Thread: using vb controls dinamically

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    TURKEY
    Posts
    37
    1 . how can I find a visualbasic control programatically at runtime

    I mean :

    I will click a command button at runtime and
    I will show item's name that focused before command button without describing any special property of that item.

    I doesn't want to write

    msgbox item.name (item.name is static.)

    instead I want to write code that firstly find which item focused before command button and then show its name.

    (item.name is dinamic.)

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    hmm

    Let me make sure I understand first

    You want to click on a command button... and you want to know what item had focus before you clicked that button
    correct?

    let me know

    Thanks

  3. #3
    Guest
    You mean something like this?
    Code:
    Dim LastControl As String
    
    Private Sub Command1_Click()
        MsgBox LastControl
    End Sub
    
    Private Sub Command2_LostFocus()
        'Store Command2 in LastControl
        LastControl = Command2.Name
    End Sub
    
    Private Sub Picture1_LostFocus()
        'Store Picture1 in LastControl
        LastControl = Picture1.Name
    End Sub

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    TURKEY
    Posts
    37

    YES . you understand

    yes , you understand correctly LAFOR .

    (sorry. my explanation is very confusing)


  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    TURKEY
    Posts
    37
    thank you fo your answer megatron

    can't I use control's collection to find last focused item.

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