Jump to content
vickerps

Tab between control on a child form

Recommended Posts

vickerps

Anyone know of a way to give focus to a child gui form for the purpose of tabing between controls?

Any help would be appreciated :)

#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <ComboConstants.au3>
#Include <GuiIPAddress.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <GUIConstants.au3>
Global $Lbl_Title,$Version,$AnwserFile,$WorkingFile,$Form,$Bmp,$fW = @DesktopWidth/2, $fh = @DesktopHeight/2, $fx = @DesktopWidth/3.5, $fy = @DesktopHeight/4,$B_Button1
$Version = 'V1.0'
$AnwserFile = StringTrimRight(@ScriptName,3) & "ini"
$WorkingFile = @ScriptDir & "\Working.ini"
$BMP = @ScriptDir & "\BackGround.bmp"
$Title = IniRead ($AnwserFile,"Settings","Title","TITLE GOES HERE")
$Form = GuiCreate('',$fW,$fh,$fx,$fy,$WS_CAPTION+$WS_SYSMENU+$WS_MINIMIZEBOX)
  GUICtrlCreatePic ($BMP,0,0,$fW,$fh)
  GUICtrlSetState(-1,$GUI_DISABLE)
$Lbl_InstVer = GUICtrlCreateLabel($Version,10,0,$fW-20,12,$SS_RIGHT)
  GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
  GUICtrlSetFont(-1,8)
  GUICtrlSetState(-1,$GUI_DISABLE)
$Lbl_Title = GUICtrlCreateLabel($Title,10,$fh-$fh+20,$fW-20,35)
  GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
  GUICtrlSetFont(-1,18,250,0,'Tahoma')
$Hdr = GUICtrlCreateGraphic(0, $fh-$fh+60 ,$fW, 5,$SS_SUNKEN)
  GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
$Ftr = GUICtrlCreateGraphic(0, $fh-55,$fW,5,$SS_SUNKEN)
  GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW,$Form)
Form2($fw,$fh,0,0)
Func form2($fw,$fh,$fx,$Fy)
Global $B_Button1
$Message1 = "No Message provided"
$F = GuiCreate('',$fW,$fh,$fx,$fy,$WS_CHILD,'',$Form)
GUICtrlSetData($Lbl_Title,$Title)
$Lbl_Message1 = GUICtrlCreateLabel($Message1,10,70,$FW-20,65)
$Lbl_Computername = GUICtrlCreateLabel("&Computer name:",60,140,130,20)
$I_ComputerName = GUICtrlCreateInput('',200,140,150,20,$ES_UPPERCASE)
$Lbl_IP = GUICtrlCreateLabel("Static &IP address:",60,280,130,20)
$I_IP = _GUICtrlIpAddress_Create ($F,200,280,110,20)
$Lbl_Subnet = GUICtrlCreateLabel("Subnet &mask:",60,305,130,20)
$I_Subnet = _GUICtrlIpAddress_Create($F,200,305,110,20)
$Lbl_Gateway= GUICtrlCreateLabel("Default &gateway:",60,330,130,20)
$I_Gateway = _GUICtrlIpAddress_Create($F,200,330,110,20)
$B_Button1 = GUICtrlCreateButton('&Next',$fW-102,$fh-43,100,40,$BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW,$F)
WHILE 1
  $Msg=GUIGetMsg()
  Switch $Msg
   Case $GUI_EVENT_CLOSE
       Exit 1
   Case $B_Button1
   ExitLoop
  EndSwitch
WEnd
GUIDelete($F)
EndFunc

Share this post


Link to post
Share on other sites
vickerps

Ok think i solved my own problem :)

$F = GuiCreate('',$fW,$fh,$fx,$fy,$WS_Popup,$WS_EX_MDICHILD,$Form)

Share this post


Link to post
Share on other sites
ericbartha

Sorry to resurrect an old thread, but @vickerps, did this wind up working for you? I have my child form centered and when I applied the MDICHILD extension it loses its vertical centering but retains its horizontal center.

Does anyone have a good solution for being able to tab through a child form? 

Share this post


Link to post
Share on other sites
JLogan3o13

@ericbartha as you yourself seem to realize, there is little point in resurrecting a thread after almost 4 years. The language has progressed just a bit in that time. If you have a question, you are much more likely to get assistance by following this format:

  • Start a new topic of your own rather than resurrecting someone else's problem.
  • Give a detailed description of what problem you are facing, what you have tried, and where you're stuck.
  • Post code 
  • If you feel this, or another, dead post speaks to what you're trying to do, explain that in your post and link to this one for reference.

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×