Hi,
I have a LabelControl placed inside a XtraScrollableControl. The XtraScrollableControl is resizable accordingly to the form size.
I want to show only the VerticalScroll, and never the HorizontalScroll.
For this, on the Resize event of the XtraScrollableControl I set the LabelControl's Size to the XtraScrollableControl.ClientSize. This works fine most of the time, but … when resizing the form I see the HorizontalScroll appearing and disappearing.
Is there something I can do so that the HorizontalScroll never appears, since it's not needed.
Thanks.
We have closed this ticket because another page addresses its subject:
Allow explicit control over scroll bar visibility in XtraScrollableControl
Hi Ion,
Thank you for your question. I suggest that you set the XtraScrollableControl.HorizontalScroll.Visible property to false, to accomplish this task.
Please try this solution, and let us know whether or not it meets your requirements.
Thanks,
Uriah
Hi,
I've set this property to false when creating the XtraScrollableControl, but this does not work.
I assume that when the XtraScrollableControl is resized the property is ignored?
Can you please tell me when I should set this property?
Hi Ion,
I am afraid XtraScrollableControl does not provide a way to hide a particular scrollbar. We have the Allow explicit control over scroll bar visibility in XtraScrollableControl suggestion to implement this functionality. At this moment we have decided not to introduce it since we think that this functionality will be used only in rare cases.
Thanks,
Gosha
Hi Gosha,
Can you please tell me the best approach for my scenario so that I can avoid the appearance of the horizontal bar?
Thanks.
Hi Ion,
You can use VScrollBar and draw your label in the required bounds in the Scroll event handler.
Alternatively, use your first approach, but execute your code in the Layout event handler instead of the Resize event handler.
Thanks,
Gosha
Hi Gosha,
I've placed my code inside the Layout event and everything is OK now.
Thanks.
Hi Ion,
I am happy to hear that the problem is resolved now. Thank you for informing us of that.
Please do not hesitate to contact us if you experience problems when using our products. We will be happy to help you at any time.
Thanks,
Gosha
solved