Print Page | Close Window

[SOLVED] TaskPanelGroupItem SetSize Issue

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=16678
Printed Date: 17 May 2024 at 8:49am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] TaskPanelGroupItem SetSize Issue
Posted By: Xander75
Subject: [SOLVED] TaskPanelGroupItem SetSize Issue
Date Posted: 09 May 2010 at 9:00am
I have placed a ReportControl inside a PictureBox control then placed the PictureBox control inside a TaskPanelGroup.

Code:

    Dim Group As TaskPanelGroup
    Dim Item As TaskPanelGroupItem

    Set Group = TaskPanel.Groups.Add(1, "Group By")
    Group.Expanded = True

    Set Item = Group.Items.Add(1, "Test 1", xtpTaskItemTypeControl, 1)
    Set Item.Control = Picture1
    Item.SetSize 0, 0, True
    DoEvents

    ReportControl.Move 0, 0, Picture1.Width, Picture1.Height

However using Item.SetSize 0, 0, True autosizes but does not fit the TaskPanelGroupItem exactly!

I have tried using Item.SetMargins, which I can use to correctly position the left and top margins correctly but I can't find the height and width of the TaskPanelGroupItem.

Does anybody know how to resolve this issue?




-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)



Replies:
Posted By: Xander75
Date Posted: 09 May 2010 at 9:58am
I have since resolved this issue. I was using the SetSize and SetMargins incorrectly the first time I looked at this, after going away for a few minutes I realised how to resolve it... typical!!!

Code:

Private Sub CreateToolbox()
    Dim Group As TaskPanelGroup
    Dim Item As TaskPanelGroupItem

    Set Group = TaskPanel.Groups.Add(1, "Group By")
    Group.Expanded = True

    Set Item = Group.Items.Add(1, "Test 1", xtpTaskItemTypeControl, 1)
    Set Item.Control = Picture1
    Item.SetSize 0, 0, True            
    Item.SetMargins -8, -5, -8, -5  
End Sub

Private Sub Form_Resize()
    ' Resize the TaskPanel on Form Resize
    TaskPanel.Move TaskPanel.left, TaskPanel.top, TaskPanel.Width, Me.ScaleHeight - TaskPanel.top - 120

    ' Resize the rpcGroupBy ReportControl inside the PictureBox, the PictureBox gets resized automatically by the TaskPanel
    rpcGroupBy.Move 0, 0, picGroupBy.Width, picGroupBy.Height - 15
End Sub

Result:





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