English
Forum

Anfängerfrage ChoiceBox

 
- Page 1 -



Andre
Hilprecht
Hi,
driver% is a ChoiceBox. i want the to selection in this Box one
TextFeld (Text1&) the value undertaking and the ChoiceBox then ausgeblendet
becomes. The Choice disappears but already to the selection.
ElseIf Clicked(driver%)

Text1& = @Create("Text", %hwnd, @getText$(driver%), 30, 10, 190, 24)
SetFont Text1&, CBFont&
@DestroyWindow (driver%)
 
Ein PC ist die beste Möglichkeit Fehler zu beheben, die ohne PC gar nicht passiert wären. -frei aus Murphy's Computergesetzen

XProfan X2, Win8 Pro 64bit Update von Win7
i5 / 3,2GHz 4 GB RAM
Treibstoff: Radeberger Pils
12/17/12  
 



« this Posting watts as Solution marked. »


Thomas
Freier
Perhaps so:
cls
var driver%=CreateChoiceBox(%hwnd,"",10,110,200,200)
AddStrings(driver%,"Klaus")
AddStrings(driver%,"Werner")
AddStrings(driver%,"Tim")
declare Text1&, x%
Text1&=CreateText(%hwnd,"",10,10,300,22)
SetFont Text1&, CBFont&

while 1

    waitinput
    case getfocus(driver%) : WAEHLE_FAHRER

wend

Proc WAEHLE_FAHRER

    while getfocus(driver%)

        x%=-1
        waitinput
        x%=GetCurSel(driver%)

        If x%>-1

            SetText Text1&,Gettext$(driver%)
            DestroyWindow(driver%)
            BREAK

        endif

    wend

Endproc


there at 1. getfocus(driver%) yet no electoral met becomes, this in a Loop offer.
 
Gruß Thomas
Windows XP SP2, XProfan X2
12/17/12  
 




Andre
Hilprecht
thanks for Help, has too functions. only unfortunately if I the with
of/ one 2. ChoiceBox anwende working not. Irgendwas make I wrong.
Declare end%, Text1&, Text2&, x%, driver%, TankW%
'--------------------------------------------------------driver

Proc FAHRER

    var s$ = ""
    assign #1,"namen.aht"
    reset #1

    while hardship(eof(#1))

        input #1,s$
        addchoice(driver%,s$)

    wend

    close #1
    assign #1,""

    while getfocus(driver%)

        x% = -1
        waitinput
        x% = GetCurSel(driver%)

        If x% > -1

            Text1& = @Create("Text", %hwnd, "", 10, 10, 110, 22)
            SetText Text1&,Gettext$(driver%)
            DestroyWindow(driver%)

        endif

    wend

    TANKWAGEN

Endproc

'-------------------------------------------------------------TW

Proc TANKWAGEN

    TankW% = @Create("ChoiceBox", %hwnd,1,200,10,150,100)
    var s$ = ""
    assign #1,"TW.aht"
    reset #1

    while hardship(eof(#1))

        input #1,s$
        addchoice(TankW%,s$)

    wend

    close #1
    assign #1,""

    while getfocus(TankW%)

        x% = -1
        waitinput
        x% = GetCurSel(TankW%)

        If x% > -1

            Text2& = @Create("Text",%hwnd,"",200,10,150,22)
            SetText Text2&,Gettext$(TankW%)
            DestroyWindow(TankW%)

        endif

    wend

Endproc

'--------------------------------------------------------------------
WINDOWSTYLE 84
WINDOW 0,0 - %MaxX,%MaxY
Ende% = @Create("Button", %hWnd, "ENDE", %MaxX-120, 10, 100, 30)
Fahrer% = @Create("ChoiceBox",%hwnd,1,10,10,150,300)

while 1

    waitinput
    case getfocus(driver%) : FAHRER
    case getfocus(end%) : end

wend

 
Ein PC ist die beste Möglichkeit Fehler zu beheben, die ohne PC gar nicht passiert wären. -frei aus Murphy's Computergesetzen

XProfan X2, Win8 Pro 64bit Update von Win7
i5 / 3,2GHz 4 GB RAM
Treibstoff: Radeberger Pils
12/17/12  
 




Andre
Hilprecht
Habs yourself found, it had one SetFocus on The 2. ChoiceBox staid go.
Why it with the first Box without goes, entzieht itself me of course, but I have first time
a Solution and can moreover make.

Greeting Andre

can as Done viewing go
 
Ein PC ist die beste Möglichkeit Fehler zu beheben, die ohne PC gar nicht passiert wären. -frei aus Murphy's Computergesetzen

XProfan X2, Win8 Pro 64bit Update von Win7
i5 / 3,2GHz 4 GB RAM
Treibstoff: Radeberger Pils
12/17/12  
 




Thomas
Freier

Why it with the first Box without goes, entzieht itself me of course,

whom Focus and so the lever the first Box get through Click. thereafter erstellst You a second, on The You without request over GetFocus()/ Clicked() grab want. so is the circumstance :
while getfocus(TankW%)

    x% = -1
    waitinput
    x% = GetCurSel(TankW%)

    If x% > -1

        Text2& = @Create("Text",%hwnd,"",200,10,150,22)
        SetText Text2&,Gettext$(TankW%)
        DestroyWindow(TankW%)

    endif

wend

not erfüllt.
alternatively
while 1' new

    x% = -1
    waitinput
    x% = GetCurSel(TankW%)

    If x% > -1

        Text2& = @Create("Text",%hwnd,"",200,10,150,22)
        SetText Text2&,Gettext$(TankW%)
        DestroyWindow(TankW%)
        BREAK' new

    endif

wend

 
Gruß Thomas
Windows XP SP2, XProfan X2
12/18/12  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.198 Views

Untitledvor 0 min.
H.Brill09/15/24
RudiB.03/12/20
Peter Max Müller11/01/19
rquindt04/15/18
More...

Themeninformationen

this Topic has 2 subscriber:

Andre Hilprecht (3x)
Thomas Freier (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie