Question about controls on a form.

Discussion in 'AutoCAD' started by Yves, Feb 3, 2004.

  1. Yves

    Yves Guest

    Hi,

    I can access the tabindex of the active control,
    test = frmCadre.ActiveControl.TabIndex

    But I need to access what's written in lets say tabindex(4).

    The idea is to fill a title box with what's in a form, only if I scroll
    through all controls, well it's all the controls!

    Thanks.
     
    Yves, Feb 3, 2004
    #1
  2. Yves

    HJohn Guest

    I am not sure what you are trying to do, would you give more info. why don't you use the control name? I wonder if you could get any where with that approach.
     
    HJohn, Feb 3, 2004
    #2
  3. Nothing's written there because it's not a text property. It indicates
    the sequence in which control will receive the focus when the user
    presses the TAB key.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Feb 3, 2004
    #3
  4. This may be what you want to do.

    Private Sub UserForm_Click()
    Dim objControl As Control
    Dim intTabIndex As Integer
    For Each objControl In UserForm1.Controls
    intTabIndex = objControl.TabIndex
    If intTabIndex = 4 Then
    'do stuff here
    End If
    Next objControl
    End Sub

    Regards - Nathan
     
    Nathan Taylor, Feb 4, 2004
    #4
  5. Yves

    Yves Guest

    Well I must be missing something here.

    When I go through all the controls on the form and stop (Debug) when
    tabindex and get the name of the control, it doesn't give my the correct
    name, it looks as if it is the first control I've put on the form when
    creating it, not the Tabindex property!
     
    Yves, Feb 4, 2004
    #5
  6. Yves

    Yves Guest

    I want to create a title box on paperspace, The form would be filled with
    attributs on an existing block in the drawing.

    If the block don't exists I create it with stuff written on the form (That
    part is allready working!)

    And if the user changes the form, then the attributs would reflect the
    changes.

    Thanks.


    don't you use the control name? I wonder if you could get any where with
    that approach.
     
    Yves, Feb 4, 2004
    #6
  7. How are the controls added to the form? Did you add them to the form
    yourself (manually), or are they created by code? If you created them
    yourself, I don't think you should need to use their TabIndex to access
    them. I don't want you to rewrite your whole program if it is almost
    working, but it seems "dangerous" to base your logic for filling the form on
    the order that the TAB key cycles through your controls.

    It seems like the part you are having trouble with is when you try to fill
    your form from the titleblock. Can you post your code for this part of the
    program? Also, I added a line to Nathan's code (below) to show the names
    and tabindexes of the controls.

    James
     
    James Belshan, Feb 4, 2004
    #7
  8. On the web side I can't see the body of this reply to my message. A question to Anne Brown, can it be reposted to the web side.

    Regards - Nathan
     
    Nathan Taylor, Feb 4, 2004
    #8
  9. Yves

    Anne Brown Guest

    Here it is.
    --
    Anne Brown
    Discussion Groups Administrator
    Autodesk, Inc.


    Subject:
    Re: Question about controls on a form.
    Date:
    Wed, 4 Feb 2004 09:56:39 -0500
    From:
    "Yves" <>
    Newsgroups:
    autodesk.autocad.customization.vba

    Well I must be missing something here.

    When I go through all the controls on the form and stop (Debug)
    when
    tabindex and get the name of the control, it doesn't give my the
    correct
    name, it looks as if it is the first control I've put on the form
    when
    creating it, not the Tabindex property!


    "Nathan Taylor" <> a écrit dans le message
    de
     
    Anne Brown, Feb 4, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.