Click to See Complete Forum and Search --> : GDI+ Ruler Problem
ReconMarine
February 13th, 2008, 12:24 AM
Hi Everyone
Can someone please assist me with the following : I have attached a basic paint app. The zooming works fine, but the rulers disappear when I scroll horizontally or vertically. I need the rulers to stay fixed like for example MS Word's rulers.
Thank you very much
JonnyPoet
February 13th, 2008, 01:34 PM
Hi Everyone
Can someone please assist me with the following : I have attached a basic paint app. The zooming works fine, but the rulers disappear when I scroll horizontally or vertically. I need the rulers to stay fixed like for example MS Word's rulers.
Thank you very muchThis is a library my IDE said, so where is a testapp to use this code and to be able to start the application and run it to see your troubles. Is there something missing ?
ReconMarine
February 14th, 2008, 01:10 AM
Hi
Yes, I'm sorry, I uploaded the wrong file I see.
Here's the file that contains the library and the test app.
Thanks a million!
JonnyPoet
February 14th, 2008, 06:15 AM
Hi
Yes, I'm sorry, I uploaded the wrong file I see.
Here's the file that contains the library and the test app.
OK.I have done a short look in the moment. How to verify your problem ? As this is an editor obviously so what do I need to do to get your problem on the screen ? I'll have more time to look on it in the evening. ( its just 14h here now )
ReconMarine
February 14th, 2008, 07:37 AM
Thanks a lot for the help, I appreciate it.
You have to zoom in until the horizontal and vertical scrollbars appear.
Then when you scroll down or to the right, you will see the rulers are not shown anymore.
I have tried everything to move the rulers as the user scrolls, but to no avail.
What I need is that as the user scrolls, the rulers must still be visible.
Thanks a million.
JonnyPoet
February 14th, 2008, 01:37 PM
.....I have tried everything to move the rulers as the user scrolls, but to no avail.
What I need is that as the user scrolls, the rulers must still be visible.
....What you gave me the rulers still are there but they dont scroll. Do simple the following in the DocumentArea class
1) Add a Scroll delegate to panel1
private void panel1_Scroll(object sender, ScrollEventArgs e) {
if (e.ScrollOrientation == ScrollOrientation.HorizontalScroll) {
this.hRuler1.RulerMargin = this.drawArea1.Left + this.hRuler2.Width;
}
if (e.ScrollOrientation == ScrollOrientation.VerticalScroll) {
this.hRuler2.RulerMargin = this.drawArea1.Top;
}
}
Then your rulers will scroll with your aerea. Hope this helps. Vienna is greeting France :wave:
BTW: Excellent design, great code !
ReconMarine
February 15th, 2008, 12:50 AM
Thanks a lot for your trouble!! It works perfectly now! I can't believe I missed something so obvious :)
JonnyPoet
February 15th, 2008, 05:21 AM
Thanks a lot for your trouble!! It works perfectly now! I can't believe I missed something so obvious :)No problem. It was a pleasure to help in such a great design. I thought, that this was obviously only forgotten to add, as in the resize delegate you have it. ;) BTW Dont forget to use threadtools and sign post as resolved.
And as this seems me to be a professional project -- remove the zips.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.