| |
|
|
- Page 1 - |
|
Julian Schmidt | can someone say, wieso the the Text 'Test' the Listbox not rechtsbündig reported becomes. Ausgehend from the Logik would I say, that it functions should!?
cls
declare Text$
var lb&=Create("ListBox", %hwnd, 0, 10, 10, 152, height(%hwnd)-20)
Randomize
Addstring(lb&,Mkstr$("_",18))'18 characters benefit The Listboxbreite from
whileloop 20
case iskey(27) : end
Text$=Mkstr$(Str $(Rnd(10)),Rnd(10)+1)
'Maximale_Zeichenlänge_in_ListBox - (Anzahl_Zeichen_Linksbündig + Anzahl_Zeichen_Rechtsbündig) = Zeichenlänge_zwischen_Linkbündig_und_Rechtbündig_damit_Maximale_Zeichenlänge_in_ListBox_erreicht
Addstring(lb&,Text$+MkStr$(" ",18-(Len(text $)+Len("Test")))+"Test")
Messagebox("Länge '"+text $+"' = "+Str $(Len(text $))+" - length 'Test' = "+Str $(Len("Test"))+"\n18-("+Str $(Len(text $))+"+"+Str $(Len("Test"))+")="+Str $(Len(MkStr$(" ",18-(Len(text $)+Len("Test")))))+"\nIst "+Str $(Len(text $))+"+"+Str $(Len(MkStr$(" ",18-(Len(text $)+Len("Test")))))+"+"+Str $(Len("Test"))+" = 18?","",0)
Endwhile
while 1
waitinput
Endwhile
|
|
|
| |
|
|
|
« this Posting watts as Solution marked. » |
|
Andreas Miethe
| falser Font would I say.
$H windows.ph
$H messages.ph
cls
declare Text$
var lb&=Create("ListBox", %hwnd, 0, 10, 10, 152, height(%hwnd)-20)
sendmessage(lb&,~wm_setfont,~GetStockObject(~ANSI_FIXED_FONT),1)
Randomize
Addstring(lb&,Mkstr$("_",18))'18 characters benefit The Listboxbreite from
whileloop 20
case iskey(27) : end
Text$=Mkstr$(Str $(Rnd(10)),Rnd(10)+1)
'Maximale_Zeichenlänge_in_ListBox - (Anzahl_Zeichen_Linksbündig + Anzahl_Zeichen_Rechtsbündig) = Zeichenlänge_zwischen_Linkbündig_und_Rechtbündig_damit_Maximale_Zeichenlänge_in_ListBox_erreicht
Addstring(lb&,Text$+MkStr$(" ",18-(Len(text $)+Len("Test")))+"Test")
Messagebox("Länge '"+text $+"' = "+Str $(Len(text $))+" - length 'Test' = "+Str $(Len("Test"))+"\n18-("+Str $(Len(text $))+"+"+Str $(Len("Test"))+")="+Str $(Len(MkStr$(" ",18-(Len(text $)+Len("Test")))))+"\nIst "+Str $(Len(text $))+"+"+Str $(Len(MkStr$(" ",18-(Len(text $)+Len("Test")))))+"+"+Str $(Len("Test"))+" = 18?","",0)
Endwhile
while 1
waitinput
Endwhile
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 03/25/12 ▲ |
|
|
|
|
|
Julian Schmidt | is correct so functions it. but Why depends with the the Font together? |
|
|
| |
|
|
|
Andreas Miethe
| with this Fixed-Fonts are even any characters same wide, with others Font different.
but It's all right too with others Fonts. and without grosse Rechnerei. simply whom ExStil the Listbox Change.
$H windows.ph
$H messages.ph
cls
declare Text$
Var lb& = Control("LISTBOX","",~WS_CHILD | ~WS_VISIBLE | ~WS_BORDER,10,10,152,height(%hwnd)-20,%hwnd,2000,%hinstance)
~SetWindowLong(lb&,~GWL_EXSTYLE,~WS_EX_RIGHT)
Randomize
Addstring(lb&,Mkstr$("_",18))'18 characters benefit The Listboxbreite from
whileloop 20
case iskey(27) : end
Text$=Mkstr$(Str $(Rnd(10)),Rnd(10)+1)
'Maximale_Zeichenlänge_in_ListBox - (Anzahl_Zeichen_Linksbündig + Anzahl_Zeichen_Rechtsbündig) = Zeichenlänge_zwischen_Linkbündig_und_Rechtbündig_damit_Maximale_Zeichenlänge_in_ListBox_erreicht
Addstring(lb&,Text$+MkStr$(" ",18-(Len(text $)+Len("Test")))+"Test")
Messagebox("Länge '"+text $+"' = "+Str $(Len(text $))+" - length 'Test' = "+Str $(Len("Test"))+"\n18-("+Str $(Len(text $))+"+"+Str $(Len("Test"))+")="+Str $(Len(MkStr$(" ",18-(Len(text $)+Len("Test")))))+"\nIst "+Str $(Len(text $))+"+"+Str $(Len(MkStr$(" ",18-(Len(text $)+Len("Test")))))+"+"+Str $(Len("Test"))+" = 18?","",0)
Endwhile
while 1
waitinput
Endwhile
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 03/25/12 ▲ |
|
|
|
|
Julian Schmidt | OK, thanks Andreas. you have me very helped. |
|
|
| |
|
|