Disable & Hide 1st Row of Text Boxes In A Gui

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Roonyroo
Posts: 36
Joined: 29 Jan 2014, 20:29

Disable & Hide 1st Row of Text Boxes In A Gui

19 Feb 2014, 21:20

I just need to disable & hide the 1st row of horizontal edit boxes in the gui called guiwinxx

Again I cant figure out the syntax, no elegant solutions anyway ...

Basically disable & hide the first horizontal row labelled 1 18 15 to 64, the row still has to be referenced by the script, but be disabled & invisible to the user

Code: Select all


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

ysx:=0
textx:=0

autotrim, off

;msgbox type in guiwinx to mirror in 2nd win



SetTimer,UPDATEDSCRIPT,1000

setBatchLines -1
lp=0
y:=10
gui,4:add,text,section -vscroll x0   y%y% w0 h0,    ;-- set position for y
loop,10
{
loop,7
  {
  lp++
  Gui, 4:Add, Edit, r2 -vscroll x+7 y%y% w90 h30 gCopyText vedit%lp%, %lp%
  }
gui,4:add,text,  section -vscroll x0   y0  w0 h0,    ;-- set position for x
y +=35
}
lp:=0

Gui,4:show,autosize  x0 y150 h900,guiWINxx



setBatchLines -1
lp=0
y:=10
gui,4:add,text,section x0   y%y% w0 h0,    ;-- set position for y
loop,10
{
loop,7
  {
  lp++
  
  
  Gui, 5:Add, Edit, x+7 y%y% w90 h30 -Multi veditx%lp%,%lp%
  }
gui,5:add,text,  section x0   y0  w0 h0 ,    ;-- set position for x
y +=35
}

Gui,5:show,autosize x702 y250 h900, inputx







CopyText: 

{

 Gui, 4: Submit, nohide ; directs all textx typed to gui box 4
 
    ControlGetFocus, OutputVar, guiWINxx

newvarcsx := RegExReplace( OutputVar, "\D")

xsc:=newvarcsx+1

xscd=edit%xsc%

    ControlGetPos, xs, ys, ws, hs, %OutputVar%, inputx
    
    ControlGetPos, xsx, ysx, wsx, hsx, %xscd%, inputx

   
ControlGetText, whcyxc, %OutputVar%, guiWINxx

edit4:=""

newvarcsxt := RegExReplace( OutputVar, "\D")

tooltip, %OutputVar% %whcyxc%



;StringReplace, textx, MyText,%A_Space%,_, All ; inserts a_space in place of space in edit box & ini 

;iniwrite, %whcyxc%, %x1%, winxlxc, winxlxc%newvarcsxt%


StringReplace, textx, whcyxc,_, %A_Space% , All


  StringLen, length, textx
  
  length:=(length*5)+5


ys:=ys-25
ysx:=ysx-25
xsxc:=xs+length ; move textbox to position ending of preceding textbox



   GuiControl, 5:Text, %OutputVar%, % textx

   
   ;GuiControl, 5:Move, %OutputVar%, x%xsxc% y%ysx% w%length% h100
   
   GuiControl, 5:Move, %OutputVar%,  w%length% 
  
    xs:=0
    length:=0
    xsxc:=0
    ysx:=0
    
    
;settimer, spacex, 10
  
  
ControlGetText, whcyxc, %OutputVar%, guiWINxx


  StringLen, length, whcyxc
  length:=(length*5)+5



  ;GuiControl, 5:Move, %xscd%, x%xsxc% y%ysx%  h100
  
    ControlGetPos, xs, ys, ws, hs, %OutputVar%, inputx
  
    ControlGetPos, xsa, ysa, wsa, hsa, %OutputVar%, guiWINxx
  
    ControlGetPos, xsx, ysx, wsx, hsx, %xscd%, inputx
 
 
 
ysx:=ysx-25

ysa:=ysa-25
xsxc:=xs+length ; move textbox to position ending of preceding textbox 
 
 GuiControl, 5:Move, %xscd%, x%xsxc% y%ysa%-25
 
      
    
;GuiControl, 5:Move, %xscd%, x%xsxc% y%ysa%  h100

tooltip,  %OutputVar% xs%xs% ys%ys% %textx% %xscd% xsx%xsx% ysx%ysx% ws%ws% length%length% %whcyxc%
      
    
    xs:=0
    length:=0
    xsxc:=0
    ysx:=0


}


return 




UPDATEDSCRIPT:
FileGetAttrib,attribs,%A_ScriptFullPath%
IfInString,attribs,A
{
FileSetAttrib,-A,%A_ScriptFullPath%
SplashTextOn,,,Updated script,
Sleep,500
Reload
}
Return
;ENDOFSCRIPT

f3::pause

f2::reload
esc::exitapp





jpginc
Posts: 124
Joined: 29 Sep 2013, 22:35

Re: Disable & Hide 1st Row of Text Boxes In A Gui

19 Feb 2014, 23:54

You can use the hidden and visible control styles inside the loop, 7 for that like this:

Code: Select all

loop,7
  { firstRow := A_index == 1
  lp++
  Gui, 4:Add, Edit, r2 -vscroll x+7 y%y% w90 h30 gCopyText vedit%lp% hidden%firstRow% disabled%firstRow%, %lp%
  }

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], peter_ahk and 352 guests