Print Page | Close Window

TaskPanel not sizing added controls properly?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=17529
Printed Date: 07 May 2024 at 9:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TaskPanel not sizing added controls properly?
Posted By: Erg
Subject: TaskPanel not sizing added controls properly?
Date 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.



Replies:
Posted By: RedFin
Date 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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net