Print Page | Close Window

TabControl and VSFlexGrid

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6735
Printed Date: 17 May 2024 at 8:57pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TabControl and VSFlexGrid
Posted By: Albert1
Subject: TabControl and VSFlexGrid
Date Posted: 26 March 2007 at 11:59am
Hello,
I get a strange behavior with ComponentOne VSFlexGrid located inside a TabControl.
To simulate (VB6 environment) I use a Form with a TabControl, a TextBox and a C1 vsFlexGrid. This is the code:


Private Sub Form_Load()
    TabControl1.AutoResizeClient = True
    TabControl1.InsertItem 0, "One", Text1.hWnd, 0
    TabControl1.InsertItem 1, "Two", VSFlexGrid1.hWnd, 0
End Sub
Private Sub Form_Resize()
    TabControl1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub


When I run the code, it seems all is working good. When (at run time) I select the second Tab and, simply, click on the vsflexgrid, the child loose its autoresize and shows itself with the original positions and dimensions (top, left, with, height) becoming useless.

Someone has found any trick?

Thx






Replies:
Posted By: Oleg
Date Posted: 27 March 2007 at 1:18am
Hi,
 
You can put VSFlexGrid  to TabControl in design time (for 10.4.* version) or you can put VSFlexGrid   to PictureBox and use this picturebox in InsertItem  call.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Albert1
Date Posted: 27 March 2007 at 3:03am
Hi Oleg and thx for the reply.
I'm using 10.4.2 but I wish to setup layout at run-time. Following your suggestions I created a container for vsFlexGrid.
To get all automated (no resize event in a picturebox) I used the Component1 container (C1Elastic)


    C1Elastic1.BorderWidth = 0
    C1Elastic1.AutoSizeChildren = azUnevenHorz
    TabControl1.InsertItem 1, "Two", C1Elastic1.hWnd, 0


I noticed VSFlexGrid is the only one component that do not resize correctly. For example I tried C1 TrueDBGrid1 and all is OK.

Thank you




Posted By: Albert1
Date Posted: 27 March 2007 at 8:54am
I have found another control (I use) that does not autoresize correctly in TabControl. The name of the control is Text Control (from The Imaging Source Europe Gmbh).

So I have to use Component1 Elastic Control to be sure the client will automatically fit the tab area.

I would like to suggest (Codejock) to modify the TabControlPage control to do this job and behave (partially) as C1 Elastic (IMHO).



Posted By: yair-edsoft
Date Posted: 14 April 2007 at 11:52am

Hi,

add the Flex Grid to Picture Box it Will Resolve the Problem.
You can add (in the Picture Box) the C1Elatstic inside the picturebox and then the FlexGrid , in Case u have problems with the resize Event.


-------------
yair



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