1. listview on tabcontrol
- Posted by Jerry Story <jstory at edmc.net> Jul 15, 2003
- 448 views
The following code run on Win32lib version 0.59.8 8/June/2003 produces an error on closing. In case this is relevant, I'm using Windows NT4. ---------------------------- include win32lib.ew global constant Win = create( Window, "Listview on TabControl Problem",0,1,1,550,400,0), tc = create(TabControl,"",Win,20,40,500,500,0 ), lv = create( ListView,{"column 1","column 2","column 3"},tc,5,5,450,300, or_all({LVS_REPORT,LVS_SHOWSELALWAYS})) object index index = addLVItem( lv, 0, {"apple juice","orange juice","grapefruit juice"}) WinMain(Win,Normal) --------------------------------- Listview directly on the window is ok. List on tabcontrol is ok. Label on tabcontrol is ok. Listview on tabcontrol produces an error on closing. Jerry Story
2. Re: listview on tabcontrol
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 15, 2003
- 454 views
----- Original Message -----=20 From: "Jerry Story" <jstory at edmc.net> To: "EUforum" <EUforum at topica.com> Subject: listview on tabcontrol >=20 >=20 > The following code run on Win32lib version 0.59.8 8/June/2003 produces = > an error on closing. > In case this is relevant, I'm using Windows NT4. >=20 > ---------------------------- > include win32lib.ew >=20 > global constant Win =3D > create( Window, "Listview on TabControl Problem",0,1,1,550,400,0), > tc =3D create(TabControl,"",Win,20,40,500,500,0 ), > lv =3D create( ListView,{"column 1","column 2","column=20 > 3"},tc,5,5,450,300, > or_all({LVS_REPORT,LVS_SHOWSELALWAYS})) >=20 > object index >=20 > index =3D addLVItem( lv, 0, {"apple juice","orange juice","grapefruit=20 > juice"}) >=20 > WinMain(Win,Normal) Jerry, this works okay with the new win32lib on Windows ME, but more to the = point is that controls are not meant to be placed directly into a = TabControl. Instead, you need to create TabItem controls and place your = controls in the TabItems. Note that the positions for control are = relative to the TabControl and not the containing TabItem. Here is some reworked code... include win32lib.ew global constant Win =3D create( Window, "Listview on TabControl Problem",0,1,1,550,600,0), tc =3D create(TabControl,"",Win,20,40,500,500,0 ), ti1 =3D create(TabItem, "Tab 1", tc, 0, 0, 500, 500, 0), lv1 =3D create( ListView,{"column 1","column 2","column = 3"},ti1,10,30,410,260, or_all({LVS_REPORT,LVS_SHOWSELALWAYS})), ti2 =3D create(TabItem, "Tab 2", tc, 0, 0, 500, 500, 0), lv2 =3D create( ListView,{"column 1","column 2","column = 3"},ti2,10,30,410,260, or_all({LVS_REPORT,LVS_SHOWSELALWAYS})) object index index =3D addLVItem( lv1, 0, {"apple juice","orange juice","grapefruit = juice"}) index =3D addLVItem( lv2, 0, {"apples","oranges","grapefruits"}) WinMain(Win,Normal) --=20 Derek