Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Task Panel
  New Posts New Posts RSS Feed - TaskPanel not sizing added controls properly?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TaskPanel not sizing added controls properly?

 Post Reply Post Reply
Author
Message
Erg View Drop Down
Newbie
Newbie
Avatar

Joined: 05 November 2010
Location: US
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Erg Quote  Post ReplyReply Direct Link To This Post Topic: TaskPanel not sizing added controls properly?
    Posted: 05 November 2010 at 1:45pm
Hello,

I can't seem to get controls added to task panel groups to automatically size properly.  I add the controls, set the hwnds, etc.  The controls add fine.  When resizing, changing the layout, col width, etc., standard controls like command buttons seem to size sometimes but definitely not when multiple columns are not in use.  When multiple columns are in use the controls are always as wide as the entire control.

Also, custom controls added don't seem to size properly at all.  I have created a very basic custom control fort testing purposes.  I see the SetSize method, but how and when should that be called?  Also, the resize event never fires on the control, so how do I know when to size it manually (if that's what is required)?   I've tried using the 'automatic height' but my custom controls auto size way to tall.

When the user resizes the form (and therefore my task panel) do I need to resize each and every control on the task panel manually?  There could be 100's, this could be very time consuming. 

Thanks.
Back to Top
RedFin View Drop Down
Groupie
Groupie
Avatar

Joined: 26 March 2008
Location: Australia
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedFin Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2011 at 3:21pm

Hi,

I've been struggling with this as well, and have come up with something of a solution for me ... hopefully it might help ...

My taskpanel is on a user control and looks like this ...

It has just 2 groups. The first, for "Settings", is a fixed size.  The second group is the "Results".  I needed the second group to change size depending on whether the first group is expanded or not.  Each taskpanel group has just a single picture box control assigned to it.  Once the picture box is resized, its own resize event takes care of all of the individual controls.

Here's the code I used -

Private Enum TaskPanelGroups
tpgSettings = 1
tpgResults

End Enum

Private Sub TaskPanel1_GroupExpanded(ByVal Group As XtremeTaskPanel.ITaskPanelGroup)

With TaskPanel1
If .Groups(tpgSettings).Expanded Then
'settings group IS expanded
 .Groups(tpgResults).Items(1).SetSize picResults.width, (UserControl.ScaleHeight / 15) - 140, False
Else
'settings group NOT expanded
.Groups(tpgResults).Items(1).SetSize picResults.width, (UserControl.ScaleHeight / 15) - 45, False
End If
End With

End Sub

It was a matter of trial and error to work out how much to adjust the height by.

Hopefully this might help,

Rohan

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.