ScrollPanel not scrolling ?

Nov 13, 2009 at 1:14 PM
Edited Nov 13, 2009 at 1:40 PM

Hi

I have added a ScrollPanel to a FluidHost control on a form and added a Fluidbutton and a FluidLabel

But i am not sure how to make the panel scroll.

I have also tried to capture the MouseGesture event but is seems to not be firing .

What am i doing wrong ?

Here is the code. - I have tried with both controls on the screen or off the screen.

 

public partial class Form1 : Form
    {
        FluidButton fBtn;
        ScrollPanel scPanel;
        FluidLabel fLabel, fLabel1, fLabel2, fLabel3, fLabel4;

        public Form1()
        {
            InitializeComponent();

            fBtn = new FluidButton("Test", 10, 10, 50, 30);
            fBtn.BackColor = Color.LightBlue;
            fBtn.ForeColor = Color.White;

            scPanel = new ScrollPanel(0, 0, fluidHost1.Width, fluidHost1.Height/2);            
            scPanel.BackColor = Color.SteelBlue;
            scPanel.MouseGesture +=new EventHandler<GestureEventArgs>(scPanel_MouseGesture);
            scPanel.EnableAutoScroll = true;
            scPanel.EnableAnimation = true;
            scPanel.EnableDoubleBuffer = true ;
            scPanel.EnableScroll = true;

            fLabel = new FluidLabel();
            fLabel.BackColor = Color.LightBlue;
            fLabel.ForeColor = Color.Black;
            fLabel.Bounds = new Rectangle(10, 10, 100, 30);

            fLabel1 = new FluidLabel();
            fLabel1.BackColor = Color.LightBlue;
            fLabel1.ForeColor = Color.Black;
            fLabel1.Bounds = new Rectangle(10, 50, 100, 30);

            fLabel2 = new FluidLabel();
            fLabel2.BackColor = Color.LightBlue;
            fLabel2.ForeColor = Color.Black;
            fLabel2.Bounds = new Rectangle(10, 100, 100, 30);

            fLabel3 = new FluidLabel();
            fLabel3.BackColor = Color.LightBlue;
            fLabel3.ForeColor = Color.Black;
            fLabel3.Bounds = new Rectangle(10, 150, 100, 30);

            fLabel4 = new FluidLabel();
            fLabel4.BackColor = Color.LightBlue;
            fLabel4.ForeColor = Color.Black;
            fLabel4.Bounds = new Rectangle(10, 200, 100, 30);

            //label set below the bottom of the screen


            scPanel.Controls.Add(fBtn);
            scPanel.Controls.Add(fLabel);
            scPanel.Controls.Add(fLabel1);
            scPanel.Controls.Add(fLabel2);
            scPanel.Controls.Add(fLabel3);
            scPanel.Controls.Add(fLabel4);
                        
            fluidHost1.Add(scPanel);
            
            fluidHost1.BackColor = Color.Wheat;
        }

        

        private void scPanel_MouseGesture(Object source, GestureEventArgs g)
        {
            switch (g.Gesture)
            {
                case Gesture.Left:
                    fLabel.Text = "Left";
                    break;
                case Gesture.Right:
                    fLabel.Text = "Right";
                    break;
                case Gesture.Up:
                    fLabel.Text = "Up";
                    break;
                case Gesture.Down:
                    fLabel.Text = "Down";
                    break;
                case Gesture.RightUp:
                    fLabel.Text = "RightUp";
                    break;
                case Gesture.RightDown:
                    fLabel.Text = "RightDown";
                    break;


            }
        }

        
    }

here is the screenshot result

 

 

 

 

Thanks in advance

Dec 1, 2009 at 7:22 AM

Schow on Page "SourceCode" and click on Patches. There i have Upload a Patch that fix the Scrollpanal

Jan 4, 2010 at 12:49 AM

Thanks. But how to automatically apply the patch? Any tool you can suggest?

Jan 4, 2010 at 1:06 AM

Use the patch tool:

http://gnuwin32.sourceforge.net/packages/patch.htm

Jan 4, 2010 at 1:45 AM

Got it, thanks.

Jan 4, 2010 at 3:23 PM
M_Graf wrote:

Schow on Page "SourceCode" and click on Patches. There i have Upload a Patch that fix the Scrollpanal

 M_Graf, I installed your patch but adding a scrollpanel with buttons inside will not redraw buttons correctly after scrolled. Also tapping buttons make no effect to them. Any ideas?

Feb 1, 2010 at 12:30 PM

Got the same problem.

After scrolling the layout is massed up and I do not get any events from buttons.