This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Check Scrollbar visibility

Hello... Can i able to check scrollbar is visible in the multilayer? now i am check with "multilayer.Scrollingposition.x >0, multilayer.Scrollingposition.y >0) .But its correct in zooming.. if i change the workspacewidth or height its not correct... How can i do this?
Hello,

Could you provide me with complete sample application please?
I have attached sample.. which is a button enabled when the scroll bar is visible , to check the visibility of scroll bar is possible only changing the zoom...
Hello,

Sorry for delayed answer.

ScrollingPosition property gets the current position of the scroll bar. When you change width and height of the workspace, scroll bar is shown, but it has ScrollingPosition.X = 0, and ScrollingPosition.Y = 0 (the start coordinates (0; 0)). If you need to check whether scroll bar is visible, you can change its horizontal or vertical position a bit. Then ScrollingPosition.X will not be equal to zero.
Thanx..........then how can i do this? pls explain with sample code..................
Hello,

Here is code snippet shows how to change position of scroll bar:

private void textBox1_TextChanged(object sender, EventArgs e)
        {
            try
            {
                multiLayerViewer1.WorkspaceWidth = Convert.ToInt32(textBox1.Text);
                multiLayerViewer1.Scroll(1, 1);
                //-------------------//
                if (multiLayerViewer1.ScrollingPosition.X > 0 || multiLayerViewer1.ScrollingPosition.Y > 0)
                    button1.Enabled = true;
                else if (multiLayerViewer1.ScrollingPosition.X == 0 && multiLayerViewer1.ScrollingPosition.Y == 0)
                    button1.Enabled = false;
            }
            catch (Exception ex)
            { }
        }


I checked it. Scroll bar was defined, and button was enabled. Please try it.

If you have any additional questions please let me know.
maybe in google you can find better ways!