Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey Everyone ...

 

I've created my mainForm which I've embedded three panel controls called 'pnlTitleBar' , 'pnlToolbar' and 'pnlView' respectively. I've create a custom TitleBar which I've placed in the pnlTitleBar panel (basically, a label with a graphic and text). The other two panels will host the Toolbar and the application "Views". The Views will be the different screens (like what Outlook displays for the different folders - contacts, inbox etc).

 

I've created two UserControls named 'viewToolbar' and 'viewDashboard'. On the viewToolbar I've added a tlbMain (toolbar) and on the viewDashboard it has a Janus ExplorerBar control.

 

I have set the pnlView to dock to Top, Left, Bottom, Right and I use the following code to display the panels ...

 

'[MP]   Assign the View 'viewToolbar' to pnlToolbar
Dim Toolbar As New viewToolbar()
Toolbar.Dock = DockStyle.Fill
Me.pnlToolbar.Controls.Add(Toolbar)

'[MP]   Assign the View 'viewDashboard' to pnlView
Dim Dashboard As New viewDashboard()
Dashboard.Dock = DockStyle.Fill
Me.pnlView.Controls.Add(Dashboard)

 

My problem is this ... the pnlView won't Fill .. it stays the same size as what is in the IDE ... I'm sure I'm missing something silly, but still being new to VB.NET, any help is much appreciated!

 

Thanks!

M.

Posted

I'm not sure if my forms will work unless you have the Infragistics UltraToolbarManager control and the Janus Controls for .NET suite installed. But I've attached a screenshot of my form from the IDE so you can maybe get a better idea of what I'm trying to do. I'm trying to create an Outlook style interface, with a custom TitleBar (the titlebar will have the application logo in it).

 

As you can see in the screenshot, the white bar on top is the 'pnlTitleBar' and hosts a label (just white background for now). The pnlToolbar gets linked to the ViewToolbar UserControl (to display the Toolbars and Menu) and the pnlView is used to display the screens. Similar to Outlook's Contacts View or Inbox View.

 

I have set the control's Dock to Fill, but the UserControl itself has no Dock item in the IDE Properties ... I can only set it at run-time.

 

M.

  • *Gurus*
Posted

I can see what you're trying to do, and it should certainly work. Anything that can be added to a container on a windows form must derive from Control, and Control has a Dock property so it should be there.

 

Is this your own UserControl you're trying to add?

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

What I've done is added a New UserControl and then dropped another control on that form. I haven't setup any other methods or properties. So I guess in one sense it is a custom control of mine, but not really .. it's more of a container ...

 

M.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...