Hi,
I have some listboxes, which I think may look better without a border.
Graham had a go some time ago, but in IW his code gives an error:
http://www.ionicwind.com/forums/index.php?topic=4849.0
Is there any way in IW to remove the border from a list box - this is purely a cosmetic request,
if it can't be done then ok.
Best wishes,
Andrew.
 :)
			
			
			
				Andy, got it to compile OK, but it doesn't remove the borders. Have a play with it...
See below: Fixed!
WINDOW w1
INT run,t
declare import,GetWindowLongA(hnd:int,ind:int),int
declare import,GetDlgItem(Hwnd:int,cntid:int),int
declare import,SetWindowLongA(hwnd:int,ind:int,nwv:int),int
declare RemoveBorder(w:window,cnt:int,x:int,y:int,wi:int,h:int)
CONST gwl_style=-16
CONST gwl_exstyle=-20
const WS_EX_CLIENTEDGE=512
openwindow w1,100,100,300,250,0,0,"Borderless Listview",&handler
setwindowcolor w1,rgb(150,180,180)
control w1,@LISTBOX,"",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(window w,int cnt,int x,int y,int wi,int h)
UINT n,d
n=GetDlgItem(w1.hWnd,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 w1,x,y,wi,h,cnt
return
ENDSUB
sub handler(),int
 select @class
  case @idclosewindow
   run=0
 endselect
return 0
endsub
Brian
			
			
			
				Andy,
Got it! All of a sudden it occurred to me what was wrong. The 2024 was a
"magic number" you needed in previous versions of IB, and not needed with IWB
Change this line: n=GetDlgItem(w1.hWnd,2024+cnt)
to: n=GetDlgItem(w1.hWnd,cnt)
Brian
			
			
			
				It's a little simpler to use the IWBasic commands to do it.
WINDOW w1
INT run,t
const WS_EX_CLIENTEDGE=512
openwindow w1,100,100,300,250,0,0,"Borderless Listview",&handler
setwindowcolor w1,rgb(150,180,180)
control w1,@LISTBOX,"",70,20,150,180,@VSCROLL,1
setcontrolcolor w1,1,0,rgb(0,200,250)
' Remove the 3D border from an edit control
MODIFYEXSTYLE w1, 0, WS_EX_CLIENTEDGE|@border, 1
MODIFYSTYLE w1, 0, @border, 1
REDRAWFRAME w1, 1
for t=1 to 20
 addstring w1,1,str$(t)
next t
run=1
waituntil run=0
closewindow w1
end
sub handler(),int
 select @class
  case @idclosewindow
   run=0
 endselect
return 0
endsub
			
			
				Cleverclogs!
			
			
			
				Thanks everyone,
The listboxes look great without a border now.
Once again - thanks!
Andy.
 :)