I've edited this post to make it clear the problem:
I have a 240 width table,
I want two colums.
I have only the second column width fixed,
the first colums must adapt his width dinamically if vertical scrollbar is visible or not.
I use this code:
Code:
Public Sub FixScrollBars obj1.FromControl("tbEditor") obj1.Value = obj1.GetProperty("Controls")
obj2.Value = obj1.GetProperty2("Item", 0) 'HScrollVisible = obj2.GetProperty("Visible") 'Horizontal scroll bar visible (True o False) 'HScrollHeight = obj2.GetProperty("Height") 'Horizontal scroll height obj2.Value = obj1.GetProperty2("Item", 1) VScrollVisible = obj2.GetProperty("Visible") 'Vertical scroll bar visible VScrollWidth = obj2.GetProperty("Width") 'Vertical scroll bar width If VScrollVisible = TrueThen tbEditor.ColWidth("Word") = tbEditor.Width - priorityColumnWidth - VScrollWidth Else tbEditor.ColWidth("Word") = tbEditor.Width - priorityColumnWidth EndIf End SUb
To calculate first column width, I do:
table.width - second_column.widht - Vscrollwidth if scrollbar is visible
table.width - second_column.widht if scrollbar is NOT visible
In both cases, I've seen that the first column has ALWAYS 192 as width dimension.
It seems that tbEditor.ColWidth("Word") assignment is not considered!
Info: I call FixScrollBars function from another module (the Main module), after calling the .Show method for the form that contains the table.
I do this because If I call FixScrollBars in the Show method of the form that has the table, I've noticed that the scrollbars are not detected, infact VScrollVisible is always False!
Someone has a solution?
Last edited by ghale : 07-26-2009 at 05:45 PM.
Reason: Added more info
If you take a screen shot and blow it up you can see that the Width of a table includes the two pixel wide vertical borders at each side so the display area of a Table is four pixels less than Width property. The same is true for the Height.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.