TaskPanel with ReportControl |
Post Reply |
Author | |
AndyWilton
Groupie Joined: 03 June 2008 Status: Offline Points: 82 |
Post Options
Thanks(0)
Posted: 21 May 2009 at 3:52pm |
Hi All,
I'm trying to add a ReportControl to an Item within a TaskPanel.
I'm using the SetHandle method and all works fine when the window opens. You can expand and contract the group etc all fine, but as soon as you click on the ReportControl it moves to a location outside of the TaskPanel.
Any ideas?
Thanks in advance.
Andy
|
|
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7 Language: Clarion 5.5 -> C8.x ====================================== Andy Wilton |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi Andy,
I know how to get the ReportControl into the TaskPanel without it moving back outside of the TaskPanel when clicked. Add a PictureBox control and then place your ReportControl inside of this PictureBox. Next use the following code to attach this all to the TaskPanelGroup you wish. 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 My only issue now is to try and get the PictureBox to fit the TaskPanelGroupItem exactly! I have left the PictureBox border as black so you can see how this looks. I have tried using Item.SetMargins which allows me to set the left & top position but I can't find how to get the height and width of the TaskPanelGroupItem. As you can see from above I have used Item.SetSize however this appears to autofit the control but with margins... Does anyone know how to resolve this? |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
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: |
|
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 |