Solved

Form with embedded scrollbars

Posted on 2008-06-22
8
588 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
[X]
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
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
What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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