Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Tab order

Status
Not open for further replies.

Paul25441

Programmer
Joined
Mar 31, 2007
Messages
8
Location
BE
Hello all,

I have form with 5 controls
in some case The tab order is control1,control2,control4,control4,control5
in other cases it must be control1, control2, control3, control5
How to manage it?

regards, Paul
 
Or menu -> View -> Tab Order with your form up.

Brian
 
Place a function that returns a T/F in the "When method" A .F. would not allow Command4 get focus.



David W. Grewe (Dave)
 
Perhaps this example would be helpful.

Brian

Code:
PUBLIC form1
form1= CREATEOBJECT("form1")
form1.Show 
RETURN

DEFINE CLASS form1 AS form
  DoCreate = .T.
  Caption = "Form1"
  Name = "FORM1"

  ADD OBJECT btn1 AS commandbutton WITH ;
    Top = 24, ;
    Left = 36, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Tab1", ;
    Name = "btn1"

  ADD OBJECT btn5 AS commandbutton WITH ;
    Top = 168, ;
    Left = 36, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Tab5", ;
    TabIndex = 5, ;
    Name = "btn5"

  ADD OBJECT btn4 AS commandbutton WITH ;
    Top = 132, ;
    Left = 36, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Tab4", ;
    TabIndex = 4, ;
    Name = "btn4"

  ADD OBJECT btn3 AS commandbutton WITH ;
    Top = 96, ;
    Left = 36, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Tab3", ;
    TabIndex = 3, ;
    Name = "btn3"

  ADD OBJECT btn2 AS commandbutton WITH ;
    Top = 60, ;
    Left = 36, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Tab2", ;
    TabIndex = 2, ;
    Name = "btn2"

  ADD OBJECT command6 AS commandbutton WITH ;
    Top = 36, ;
    Left = 228, ;
    Height = 27, ;
    Width = 100, ;
    Caption = "All Tabs In Order", ;
    TabStop = .F., ;
    Name = "Command6"

  ADD OBJECT command7 AS commandbutton WITH ;
    Top = 84, ;
    Left = 228, ;
    Height = 25, ;
    Width = 100, ;
    Caption = "Skip Tab 4", ;
    TabStop = .F., ;
    Name = "Command7"

  PROCEDURE command6.Click
    WITH thisform
      FOR nBtnCnt = 1 TO 5
        cBtn = "btn"+trans(nBtnCnt)
        .&cBtn..TabIndex=nBtnCnt
        .&cBtn..TabStop=.t.
      ENDFOR 
    ENDWITH 

  PROCEDURE command7.Click
    thisform.btn4.TabStop=.f.
ENDDEFINE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top