Hi all. I am trying to create a browser window in a window that already has a listview control in it.
My problem is I can create it ok, but cannot get it to loose its caption so that it will locate on the window. I have taken all styles off except AWS_VISIBLE and I think I have set the parent right.
code below..
Can anybody tell me what I am doing wrong? ???
Regards Jeff :)
global sub main()
{
RSSwin win;
CWebBrowser browse;
CMenu m;
m.BeginMenu();
m.MenuTitle("&File");
m.MenuItem("Connect",0,1);
m.MenuItem( "Quit",0,5 );
m.EndMenu();
win.Create(0,0,895,820,AWS_CAPTION|AWS_VISIBLE|AWS_BORDER|AWS_SYSMENU|AWS_AUTODRAW|AWS_SIZE,0,"RSS Demo",NULL);
win.SetMenu(m.Detach());
win.AddControl(CTLISTVIEW,"",1,1,892,550,AWS_VISIBLE|ALVS_REPORT|AWS_BORDER,AWS_EX_CLIENTEDGE,LISTVIEW_1);
CListView *pList = win.GetControl(LISTVIEW_1);
if(pList)
{
pList->InsertColumn(0,"Title");
pList->InsertColumn(1,"Description");
plist->InsertColumn(2,"Link");
plist->SetColumnWidth(0,200);
pList->SetColumnWidth(1,350);
plist->SetColumnWidth(2,335);
pList->SetExtendedStyle(ALVS_EX_FLATSB|ALVS_EX_FULLROWSELECT|ALVS_EX_GRIDLINES|ALVS_EX_LABELTIP);
}
browse.Create(1,556,892,200,AWS_VISIBLE,0,"",win);
//create and show the status bar
version = "V0.1";
rect rc = win.GetClientRect();
int panes[2];
int width = rc.right - rc.left;
panes = width - 100,-1;
win.m_Status.CreateBar(AWS_VISIBLE,2,win);
win.m_Status.SetPanes(2,panes);
win.m_Status.SetPaneText(1,version);
win.m_Status.Resize();
browse.Navigate("http://www.ionicwind.com");
do
{
wait();
}until win.run = 0;
return;
//'win' is automatically closed here since the class destructor calls Destroy();
}
Add AWS_CHILD to the styles
Bargin!! ;D Thanks Paul!
Jeff
Your welcome. Reminds me that it should really be added by default when a parent is specified.