Page 1 of 1
ListViewGadget without any border
Posted: Fri Apr 01, 2005 10:51 pm
by Hroudtwolf
Hello, Bon Jour, Hallo, Bonjorno, Buenos Dias,
Do anyone knows n how to create a Listbox without any borders ?
(I don't want to use the containergadget-trick)
Posted: Fri Apr 01, 2005 11:08 pm
by Sparkie
Here's one for Windows only...
Code: Select all
If OpenWindow(0,0,0,270,140,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"ListViewGadget") And CreateGadgetList(WindowID(0))
ListViewGadget(0,10,10,250,120)
SetWindowLong_(GadgetID(0), #GWL_EXSTYLE, GetWindowLong_(GadgetID(0), #GWL_EXSTYLE) &(~#WS_EX_CLIENTEDGE))
For a=0 To 5
AddGadgetItem (0,-1,"Item "+Str(a)+" of the Listview")
Next
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
Posted: Fri Apr 01, 2005 11:13 pm
by Hroudtwolf
Hey thank you Wizard...äh Sparkie.
Posted: Fri Apr 01, 2005 11:15 pm
by Sparkie
You're very welcome Hroudtwolf

Posted: Fri Apr 01, 2005 11:46 pm
by Hroudtwolf
It works with parentwindows perfectly. But with childwindows isn't any result.
Posted: Fri Apr 01, 2005 11:54 pm
by Sparkie
Not sure I understand. Can you post the non-working code

Posted: Fri Apr 01, 2005 11:58 pm
by Hroudtwolf
This idea is not so good ! There are more than 1000 lines in my code.
But, I can post a part of it:
Code: Select all
Procedure NeuesFenster()
Style.l = #ws_popup|#WS_CHILD|#WS_CLIPCHILDREN|#WS_CAPTION|#WS_SIZEBOX|#WS_SYSMENU|#WS_MAXIMIZEBOX|#WS_MINIMIZEBOX
hand.l=OpenWindow (#pb_any,10+((CountList(Fenster())+1)*20),30+((CountList(Fenster())+1)*10),600,500,Style.l,"Unbekannt.pb",WindowID(hID.l))
SetParent_(WindowID(hand.l),WindowID(hID.l))
If CreateGadgetList (WindowID(hand.l))
UseWindow(hand.l)
Editor.l=EditorGadget (#pb_any,50,0,WindowWidth()-50,WindowHeight()-23)
nummern.l=ListViewGadget(#pb_any,0,0,50,WindowHeight()-23)
SetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE, GetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE) &(~#WS_EX_CLIENTEDGE))
statustext.l=TextGadget (#pb_any,0,WindowHeight()-22,WindowWidth(),20,"", #PB_Text_Border )
SendMessage_(GadgetID(Editor.l),#EM_SETBKGNDCOLOR,#NULL,$E5FFFF)
SendMessage_(GadgetID(Editor.l), #EM_EXLIMITTEXT, 0, 122880)
style = GetWindowLong_(GadgetID(Editor.l), #GWL_EXSTYLE)
newstyle = style &(~#WS_EX_CLIENTEDGE)
SetWindowLong_(GadgetID(Editor.l), #GWL_EXSTYLE, newstyle)
SetWindowPos_(GadgetID(Editor.l), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)
endIf
UseWindow(hID.l)
AddElement (Fenster())
Fenster()\handle=hand.l
Fenster()\title="Unbekannt.pb"
Fenster()\editor=Editor.l
Fenster()\status=statustext.l
Fenster()\nummern=nummern.l
EndProcedure
Posted: Sat Apr 02, 2005 12:05 am
by Sparkie
I'm on my way out the door, but I'll take a look later this evening.

Posted: Sat Apr 02, 2005 12:07 am
by Hroudtwolf
Ok. Thanks.

Posted: Sat Apr 02, 2005 12:25 am
by Blade
Sparkie wrote:Here's one for Windows only...
It doesn't work in Win2000.
The output is "standard"
Posted: Sat Apr 02, 2005 1:07 am
by Hroudtwolf
I solved the problem.
Now it works.
Code: Select all
nummern.l=ListViewGadget(#pb_any, 0,20, 50, WindowHeight ()-43)
style = GetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE)
newstyle = style &(~#WS_EX_CLIENTEDGE)
SetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE, newstyle)
SetWindowPos_(GadgetID(nummern.l), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)
Posted: Sat Apr 02, 2005 3:17 am
by Sparkie
@ Hroudtwolf - Glad to see you figured it out.
@ Blade - Maybe that's because I forgot one line of code

(SetWindowPos() with the #SWP_FRAMECHANGED flag). See if this works on 2000...
Code: Select all
If OpenWindow(0,0,0,270,140,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"ListViewGadget") And CreateGadgetList(WindowID(0))
ListViewGadget(0,10,10,250,120)
SetWindowLong_(GadgetID(0), #GWL_EXSTYLE, GetWindowLong_(GadgetID(0), #GWL_EXSTYLE) &(~#WS_EX_CLIENTEDGE))
SetWindowPos_(GadgetID(0), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOZORDER | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)
For a=0 To 5
AddGadgetItem (0,-1,"Item "+Str(a)+" of the Listview")
Next
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
Posted: Sat Apr 02, 2005 10:53 am
by Blade
Now works
