Profile Picture

Show Scrollbars in NGrouper

Posted By Fabian Baptista 14 Years Ago
Author
Message
Fabian Baptista
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 18, Visits: 1
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

Attachments
grouper.png (113 views, 17.00 KB)
Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

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.



Fabian Baptista
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 18, Visits: 1
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

Attachments
saveas.PNG (115 views, 43.00 KB)
Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

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.



Attachments
ScrollableGrouper.zip (106 views, 42.00 KB)
Fabian Baptista
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 18, Visits: 1
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

Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

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.



Fabian Baptista
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 18, Visits: 1
This works very very good. Thanks Angel!



Similar Topics


Reading This Topic