September 26, 2020, 07:18:50 pm

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Borderless Listview

Started by GWS, January 23, 2012, 12:30:12 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

Hi folks,

Here's a very old bit of Fletchie code to create a borderless listview control.

I've amended it slightly ..

Code Select

def w1:window
def run,t:int

declare "user32",GetWindowLongA(hnd:int,ind:int),int
declare "user32",GetDlgItem(Hwnd:int,cntid:int),int
declare "user32",SetWindowLongA(hwnd:int,ind:int,nwv:int),int

declare RemoveBorder(w:window,cnt:int,x:int,y:int,wi:int,h:int)

setid "gwl_style",-16
setid "gwl_exstyle",-20
setid "WS_EX_CLIENTEDGE",512

window w1,100,100,300,250,0,0,"Borderless Listview",handler
setwindowcolor w1,rgb(150,180,180)

control w1,"L,ListBox1,70,20,150,180,@VSCROLL,1"
setcontrolcolor w1,1,0,rgb(0,200,250)

' Parameters for RemoveBorder: window,control,x,y,width,height
' should be same as given in control statement ..

RemoveBorder(w1,1,70,20,150,180)

for t=1 to 20
addstring w1,1,str$(t)
next t

run=1
waituntil run=0

closewindow w1
end

sub RemoveBorder(w,cnt,x,y,wi,h)
def n,d:int

n=GetDlgItem(w,2024+cnt)
d=GetWindowLongA(n,@gwl_style)
d=d & not(@border)
SetWindowLongA(n,@gwl_style,d)
d=getWindowLongA(n,@gwl_exstyle)
d=d & not(@ws_ex_clientedge)
SetWindowLongA(n,@gwl_exstyle,d)

setsize w,x,y,wi,h,cnt

return

sub handler
select @class
  case @idclosewindow
   run=0
endselect
return



best wishes, :)

Graham
Tomorrow may be too late ..