By Fabian Baptista 1 - Saturday, April 17, 2010
Hi all, I have a NGrouper control. I'm adding dinamicaly controls to this grouper, but, i need that it can autoscroll, since i'm adding a lot of controls. How can y do this?
Thanks in advance. Fabián
|
By Angel Chorbadzhiev - Monday, April 19, 2010
Hi Fabian, You can add an NUIPanel to the NGrouper.Controls collection and set its Dock property to Fill, and also its AutoScroll property to true. Then, you can add your controls into this panel instead of the grouper. This way a scrollers will appear when needed. I hope this approach works for you. Regards, Angel.
|
By Fabian Baptista 1 - Wednesday, April 21, 2010
Hi, thanks for your answer. I have already try that but doesn't work.
Autoscroll = true in NUIPanel still show unscrolled panel. Any other suggestion? thanks
|
By Angel Chorbadzhiev - Thursday, April 22, 2010
Hi Fabian, Please, find the attached project! In it there is a grouper that hosts a NUIPanel with two buttons. When you click on the lower button its location changes and a scroller should appear. Regards, Angel.
|
By Fabian Baptista 1 - Tuesday, May 11, 2010
Hi Angel, thanks for your code. This work fine when the the "Location" Properties of a control inside the nuipanel change, but, in this case I'm adding dinamicaly controls in docking state (Bottom).
In your example : for (int i = 0; i < 20; i++) { m_Button2 = new NButton(); m_Button2.Dock = DockStyle.Bottom; m_Button2.Text = "Click me!"; m_Panel.Controls.Add(m_Button2); }
In that case, the panel is not scrolling. Any work arround?
Thanks
|
By Angel Chorbadzhiev - Wednesday, May 12, 2010
Hi Fabian, Try to set the MinScrollSize property of the NUIPanel to the size of the containing rectangle of the controls in it. For example you can modify the code you post as follows: int height = 0;for (int i = 0; i < 20; i++){ m_Button2 = new NButton(); m_Button2.Dock = DockStyle.Bottom; m_Button2.Text = "Click me!"; m_Panel.Controls.Add(m_Button2); height += m_Button2.Height; } int width = nuiPanel1.Width - SystemInformation.VerticalScrollBarWidth - (2 * m_Panel.BorderWidth);m_Panel.MinScrollSize = new Size(width , height);I hope it helps. Regards, Angel.
|
By Fabian Baptista 1 - Saturday, May 22, 2010
This works very very good. Thanks Angel!
|
|