| |
|
|
Ernst | Hello experts! The Inputs in the Edit should for further processing with <Enter> completed go (analog How with Input; it but should even not a Own Input-Dialogbox his). the inquire the Enter-Button is no trouble, but how can I the störenden Beep unterbinden? I Have already geraume Time gegooglet, but without something verwertbares to find. has someone a profane- or api-Solution ? Regards serious |
|
|
| |
|
|
|
RudiB. | whatever for a Beep... habs time tested.... here example from the Forum...
$H windows.ph
Def CN(2) If(%message = $0111,((&lparam = &(1)) And (HiWord(&wparam) = &(2))),0)
Def EN_CHANGE(1) CN(&(1),$0300)
Def EnterOn(1) (%key = 13) And (&lparam = &(1))
Cls
Var test& = Control("DIALOG","",$54000000,310,10,200,24,%hwnd,0,%hinstance)
Var Ed& = Create("Edit",test&,"Hier is the Text",0,0,200,24)
SetFocus(Ed&)
Print "Taste or Enter drücken"
While 1
WaitInput
Locate 2,1
If %key = 2
Break
ElseIf EnterOn(Ed&)
Print "Enter pressed " + GetText$(&lparam)
ElseIf EN_CHANGE(Ed&)
Print GetText$(&lparam)
EndIf
Wend
|
|
|
| |
|
|
|
Ernst | Vielen Dank; whom Code Jörg I had already time seen, was but now apparently not able it again zufinden
with obigem code have I now the Edit with colour hinterlegt, however with read-only is the colour lane (grauer background) - likewise without colour ( weißer background) becomes on gray staid.
$H windows.ph
$H messages.ph
Def CN(2) If(%message = ~WM_COMMAND,((&lparam = &(1)) And (hiword(&wparam) = &(2))),0)
Def EN_CHANGE(1) CN(&(1),~EN_CHANGE)
Def EnterOn(1) (%key = 13) And (&lparam = &(1))
Declare OCP&,Brush&
' -------------------------------------------------------------------------------------
Proc ControlProc
parameters Wnd&, Msg&, wParam&, lParam&
IF Brush&
~DeleteObject(Brush&)
Endif
If msg&=~WM_CTLCOLOREDIT or msg&=~WM_CTLCOLORSTATIC
Brush& = ~CreateSolidBrush(RGB(255,255,170))
~SetBkMode(wParam&, ~TRANSPARENT)
Return Brush&
Endif
Return ~CallWindowProc(OCP&,Wnd&, Msg&, WParam&, LParam&)
Endproc
' -------------------------------------------------------------------------------------
CLS
Var test& = Control("DIALOG","",$54000000,310,10,200,24,%hwnd,0,%hinstance)
Var Ed& = Create("Edit",test&,"Hier is the Text",0,0,200,24)
OCP& = ~SetWindowLong(test&,~GWL_WNDPROC, ProcAddr(ControlProc,4))
SetFocus(Ed&)
SendMessage(ed&,$CF,1,0)' read only
Print "Taste or Enter drücken"
While 1
WaitInput
Locate 2,1
If %key = 2
Break
ElseIf EnterOn(Ed&)
Print "Enter pressed " + GetText$(&lparam)
ElseIf EN_CHANGE(Ed&)
Print GetText$(&lparam)
EndIf
EndWhile
IF Brush&
~DeleteObject(Brush&)
Endif
End
there now irgendeine Possibility, the Edit on read-only To settle, where but the Backgroundcolor receive remaining ?
Regards and Thanks in the Vorhinein
hab's already gefunden; if the Edit read-only is, sends not ~WM_CTLCOLOREDIT separate ~WM_CTLCOLORSTATIC. in the code (supra) eingefügt and funkt. - JUHU |
|
|
| |
|
|