![]() |
TaskPanel not sizing added controls properly? |
Post Reply ![]() |
Author | |
Erg ![]() Newbie ![]() Joined: 05 November 2010 Location: US Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() 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.
|
|
![]() |
|
RedFin ![]() Groupie ![]() ![]() Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
![]() ![]() ![]() ![]() ![]() |
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 TaskPanelGroupstpgSettings = 1tpgResults 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 It was a matter of trial and error to work out how much to adjust the height by. Hopefully this might help, Rohan |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |