Hi ich verstehe das nicht!
Folgendes ich möchte bei einer ChoiceBox den Ausgewählten Inhalt auslesen.
Mittels GetText$
In diesem Beispiel bekomme ich den Eintrag von der Letzen Auswahl und nicht die aktuelle (Standard Code vom LemonVID).
Code
' Code erzeugt mit F.Abbing's LemonViD Version 1.0.0.3 am 30.05.2013 um 21:56 Uhr,
' Spenden-Button, sowie weitere Freeware-Tools für XProfan auf [URL='http://frabbing.net']Webpage Frabbing[/URL]
' Technischer Support auf [URL='http://www.paules-pc-forum.de/forum/xprofan']XProfan - Paules-PC-Forum.de[/URL] und [URL='http://purebasic.fr/german']PureBoard • Foren-Übersicht[/URL]
' --------------------------------------------------------------------------------------------------
Declare nurso%, static1%, text1%, gridbox1%, choicebox1%
Def GetStockObject(1) !"GDI32","GetStockObject"
Def GetSysColor(1) !"USER32","GetSysColor"
Def GetParent(1) !"USER32","GetParent"
Def GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
Def &COLOR_BTNFACE $F
Def &DEFAULT_GUI_FONT $11
Def &WM_COMMAND $111
Proc CreateElements
WindowStyle 26 | 512 | 2048
WindowTitle "Arbeitsfenster"
Window 280, 0 - 1630, 1030
Cls GetSysColor(&COLOR_BTNFACE)
SetDialogFont GetStockObject(&DEFAULT_GUI_FONT)
static1% = Create("Text", %hwnd, "", 344, 280, 456, 240)
text1% = Create("Text", static1%, "text", 32, 24, 64, 24)
choicebox1% = Create("ChoiceBox", static1%, 0, 152, 128, 120, 200)
@AddString(choicebox1%,"Noch nicht gemahnte Rechnungen")
@AddString(choicebox1%,"I Mahnung")
@AddString(choicebox1%,"II Mahnung")
@AddString(choicebox1%,"III Mahnung")
@AddString(choicebox1%,"Inkasso")
gridbox1% = Create("Gridbox", static1%, "gridbox;0;144", 0, 136, 16, 160, 64)
EndProc
SubclassProc
Select %smessage
CaseOf $114, $115
SendMessage(%hwnd, %smessage, &swparam, &slparam)
CaseOf $101, $202, $205, $208
SendMessage(%hwnd, &WM_COMMAND, MakeLong(GetDlgCtrlID(&swnd), 0), &swnd)
EndSelect
Endproc
Proc MainLoop
UserMessages 16
ShowWindow(%hwnd, 1)
Subclass text1%, 1 : Subclass gridbox1%, 1 : Subclass choicebox1%, 1
While 1
WaitInput
Case %umessage = 16 : BREAK
If Clicked(gridbox1%)
ElseIf Clicked(choicebox1%)
Print GetText$(choicebox1%)
EndIf
EndWhile
Subclass text1%, 0 : Subclass gridbox1%, 0 : Subclass choicebox1%, 0
EndProc
Proc Main
CreateElements
MainLoop
EndProc
Main
End
Alles anzeigen
In diesem Beispiel ist die Rückgabe OK!
Code
' Code erzeugt mit F.Abbing's LemonViD Version 1.0.0.3 am 30.05.2013 um 21:56 Uhr,
' Spenden-Button, sowie weitere Freeware-Tools für XProfan auf [URL='http://frabbing.net']Webpage Frabbing[/URL]
' Technischer Support auf [URL='http://www.paules-pc-forum.de/forum/xprofan']XProfan - Paules-PC-Forum.de[/URL] und [URL='http://purebasic.fr/german']PureBoard • Foren-Übersicht[/URL]
' --------------------------------------------------------------------------------------------------
Declare nurso%, static1%, text1%, gridbox1%, choicebox1%, ComboBoxInfo#, listbox%
Def GetStockObject(1) !"GDI32","GetStockObject"
Def GetSysColor(1) !"USER32","GetSysColor"
Def GetParent(1) !"USER32","GetParent"
Def GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
Def &COLOR_BTNFACE $F
Def &DEFAULT_GUI_FONT $11
Def &WM_COMMAND $111
'******************************************************************
Def &CB_GETCOMBOBOXINFO $164
Struct ComboBoxInfo = cbSize&, rcItem#(16), rcButton#(16), stateButton&, hwndCombo&, hwndItem&, hwndList&
Dim ComboBoxInfo#, ComboBoxInfo
'********************************************************************
Proc CreateElements
WindowStyle 26 | 512 | 2048
WindowTitle "Arbeitsfenster"
Window 280, 0 - 1630, 1030
Cls GetSysColor(&COLOR_BTNFACE)
SetDialogFont GetStockObject(&DEFAULT_GUI_FONT)
static1% = Create("Text", %hwnd, "", 344, 280, 456, 240)
text1% = Create("Text", static1%, "text", 32, 24, 64, 24)
choicebox1% = Create("ChoiceBox", static1%, 0, 152, 128, 120, 200)
ComboBoxInfo#.cbSize& = SizeOf(ComboBoxInfo#)
SendMessage(choicebox1%, &CB_GETCOMBOBOXINFO, 0, ComboBoxInfo#)
listbox% = ComboBoxInfo#.hwndList&
@AddString(choicebox1%,"Noch nicht gemahnte Rechnungen")
@AddString(choicebox1%,"I Mahnung")
@AddString(choicebox1%,"II Mahnung")
@AddString(choicebox1%,"III Mahnung")
@AddString(choicebox1%,"Inkasso")
gridbox1% = Create("Gridbox", static1%, "gridbox;0;144", 0, 136, 16, 160, 64)
EndProc
SubClassProc
Select %smessage
CaseOf $114, $115
SendMessage(%hwnd, %smessage, &swparam, &slparam)
CaseOf $101, $202, $205, $208
SendMessage(%hwnd, &WM_COMMAND, MakeLong(GetDlgCtrlID(&swnd), 0), &swnd)
EndSelect
Endproc
Proc MainLoop
UserMessages 16
ShowWindow(%hwnd, 1)
Subclass text1%, 1 : Subclass gridbox1%, 1 : Subclass listbox%, 1
While 1
WaitInput
Case %umessage = 16 : BREAK
If Clicked(gridbox1%) 'static1% -> #window
ElseIf Clicked(choicebox1%) '#window
Print GetText$(choicebox1%)
EndIf
EndWhile
Subclass text1%, 0 : Subclass gridbox1%, 0 : Subclass listbox%, 0
EndProc
Proc Main
CreateElements
MainLoop
EndProc
Main
End
Alles anzeigen
Und in diesem Beispiel wird noch nicht mal die %smessage gefüllt!
Code
' Code erzeugt mit F.Abbing's LemonViD Version 1.0.0.3 am 30.05.2013 um 21:56 Uhr,
' Spenden-Button, sowie weitere Freeware-Tools für XProfan auf [URL='http://frabbing.net']Webpage Frabbing[/URL]
' Technischer Support auf [URL='http://www.paules-pc-forum.de/forum/xprofan']XProfan - Paules-PC-Forum.de[/URL] und [URL='http://purebasic.fr/german']PureBoard • Foren-Übersicht[/URL]
' --------------------------------------------------------------------------------------------------
Declare nurso%, static1%, text1%, gridbox1%, choicebox1%, ComboBoxInfo#, listbox%
Def GetStockObject(1) !"GDI32","GetStockObject"
Def GetSysColor(1) !"USER32","GetSysColor"
Def GetParent(1) !"USER32","GetParent"
Def GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
Def &COLOR_BTNFACE $F
Def &DEFAULT_GUI_FONT $11
Def &WM_COMMAND $111
'******************************************************************
Def &CB_GETCOMBOBOXINFO $164
Struct ComboBoxInfo = cbSize&, rcItem#(16), rcButton#(16), stateButton&, hwndCombo&, hwndItem&, hwndList&
Dim ComboBoxInfo#, ComboBoxInfo
'********************************************************************
Proc CreateElements
WindowStyle 26 | 512 | 2048
WindowTitle "Arbeitsfenster"
Window 280, 0 - 1630, 1030
Cls GetSysColor(&COLOR_BTNFACE)
SetDialogFont GetStockObject(&DEFAULT_GUI_FONT)
static1% = Create("Text", %hwnd, "", 344, 280, 456, 240)
text1% = Create("Text", static1%, "text", 32, 24, 64, 24)
gridbox1% = Create("Gridbox", static1%, "gridbox;0;144", 0, 136, 16, 160, 64)
choicebox1% = Create("ChoiceBox", static1%, 0, 152, 128, 120, 200)
ComboBoxInfo#.cbSize& = SizeOf(ComboBoxInfo#)
SendMessage(choicebox1%, &CB_GETCOMBOBOXINFO, 0, ComboBoxInfo#)
listbox% = ComboBoxInfo#.hwndList&
@AddString(choicebox1%,"Noch nicht gemahnte Rechnungen")
@AddString(choicebox1%,"I Mahnung")
@AddString(choicebox1%,"II Mahnung")
@AddString(choicebox1%,"III Mahnung")
@AddString(choicebox1%,"Inkasso")
EndProc
SubClassProc
Select %smessage
CaseOf $114, $115
SendMessage(%hwnd, %smessage, &swparam, &slparam)
CaseOf $101, $202, $205, $208
SendMessage(%hwnd, &WM_COMMAND, MakeLong(GetDlgCtrlID(&swnd), 0), &swnd)
EndSelect
Endproc
Proc MainLoop
UserMessages 16
ShowWindow(%hwnd, 1)
Subclass text1%, 1 : Subclass gridbox1%, 1 : Subclass listbox%, 1
While 1
WaitInput
Case %umessage = 16 : BREAK
If Clicked(gridbox1%) 'static1% -> #window
ElseIf Clicked(choicebox1%) '#window
Print GetText$(choicebox1%)
EndIf
EndWhile
Subclass text1%, 0 : Subclass gridbox1%, 0 : Subclass listbox%, 0
EndProc
Proc Main
CreateElements
MainLoop
EndProc
Main
End
Alles anzeigen
Ich würde gerne verstehen warum das so ist.
In der Hilfe fand ich keine Infos.
Windows 8 - 64