Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Task Panel
  New Posts New Posts RSS Feed - [SOLVED] TaskPanelGroupItem SetSize Issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] TaskPanelGroupItem SetSize Issue

 Post Reply Post Reply
Author
Message
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] TaskPanelGroupItem SetSize Issue
    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)
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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:


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.