How do we get the Vvariables from gui control in class *OOP Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
murataygun
Posts: 104
Joined: 07 Aug 2015, 15:53

How do we get the Vvariables from gui control in class *OOP

03 Sep 2021, 07:05

How do we get the Vvariable value in "Kaydet" function.

Code: Select all

(new test())

class test {

    __New() {
        static
        Gui Add, Edit, vEdtValue x34 y33 w120 h21
        Gui Add, Button, x36 y76 w80 h23 HWNDhandlehwnd_Kaydet, &OK

        BF_Kaydet := ObjBindMethod(this, "Kaydet")
        GuiControl, +g, % handlehwnd_Kaydet, % BF_Kaydet
        
        Gui Show, w620 h420, Window
   }
   
    Kaydet() {

        Gui, submit, NoHide
        msgbox % this.EdtValue
    }
}
just me
Posts: 9576
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: How do we get the Vvariables from gui control in class *OOP  Topic is solved

03 Sep 2021, 07:23

As an example:

Code: Select all

(new test())

class test {
   __New() {
      Gui Add, Edit, x34 y33 w120 h21 hwndEdtHwnd
      This.EdtHwnd := EdtHwnd
      Gui Add, Button, x36 y76 w80 h23 hwndBtnHwnd, &OK
      This.BtnHwnd := BtnHwnd

      BF_Kaydet := ObjBindMethod(This, "Kaydet")
      GuiControl, +g, % BtnHwnd, % BF_Kaydet

      Gui, Show, w620 h420, Window
   }
   Kaydet(CtrlHwnd, Event, Info, ErrLvl = "") {
      GuiControlGet, EdtValue, , % This.EdtHwnd
      MsgBox, %EdtValue%
   }
}
Esc::ExitApp
User avatar
raron
Posts: 37
Joined: 11 Aug 2014, 00:50

Re: How do we get the Vvariables from gui control in class *OOP

04 Sep 2021, 13:14

Very timely, I was just wondering about this as well.
Thank you!

Return to “Ask for Help (v1)”

Who is online

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