Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Form with embedded scrollbars

Posted on 2008-06-22
8
585 Views
Last Modified: 2010-08-05
Hello,

I'm trying to get some scrollbars into my main window. In older Windows days (MFC) you set a windows style and you get nice embedded scrollbars.

I didn't find something like that in Windows Forms. So I took HScrollBar and VScrollBar with docking 'bottom' and 'right'.
But the result is not satisfying. The bottom right corner of the window, where the two ScrollBars come together doesn't look like you know it from standard windows applications.
The scrollbars are overlapping. But I want the size gripper between them.

Any suggestions ?
0
Comment
Question by:Pacman
8 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 21843916
have you tried the AutoScroll property? Scrollbar will be shown just when some control exceeds the form borders.
0
 
LVL 9

Author Comment

by:Pacman
ID: 21843968
I'm not sure if AutoScroll will do the job here. I think it's only for scrolling controls.
I have no controls inside my frame window. I want to render some graphics and use scrollbars to navigate.
0
 
LVL 6

Expert Comment

by:Bruce_1975
ID: 21844164
You can use a panel. Docking should be set to Top to use the autoscroll feature.

Regards,
Bruce
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 21844180
You can still use AutoScroll. Then simply put your graphics into a PictureBox control, with it's SizeMode property set to AutoSize. Don't dock the PictureBox at all, but place it at location (0, 0).

This will cause the picturebox to grow to fit the size of the image, and if larger than the form, cause the scrollbars to appear.

Wayne
0
 
LVL 9

Author Comment

by:Pacman
ID: 21844185
As said I cannot use the autoscroll feature because I need to set the min/max values manually. AutoScroll only works with controls in your panel.

But I've found a solution now:

I've to build the form and use HScrollBar and VScrollBar without docking but with ANCHORS..
0
 
LVL 9

Author Comment

by:Pacman
ID: 21844193
webtubbs

It's not so easy because I dont work with GDI graphics. I'm on OpenGL ...
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 21844209
OK, fair enough, but can't you just load the created image into the picturebox?

    PictureBox1.Image = MyImage

I could be wrong though, because I know bugger-all about OpenGL.

BTW, posting your comment after choosing to close the question caused a "Request for Review" to be made to Community Support ( http:/Q_23506807.html ). You will need to restart the process.

Wayne

0
 
LVL 9

Accepted Solution

by:
Pacman earned 0 total points
ID: 21845230
I don't have an image in that way. The OpenGl drawing commands go directly to the rendering pipe.

OK I will close this question now.
I've found the solution:

Take a panel control and put HScrollBar and VScrollBar and the OpenGL drawing control in it.
Set Anchors of Scrollbars and the drawing control so that resizing the panel will resize the child controls also.

This is the same technique as the visual studio text editor uses (you can see it with Spy++).

Thank you for your hints.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Checking a checkbox based on SQL DataReader boolean value in ASP.NET(VB) 2 32
SQL Query Help Top 1 and Distinct? 6 35
Finding the IIS version 5 21
Where is this file? 3 25
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question