• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

A scrollbar problem (.NET C#)

lozina

Lifer
I'm struggling to figure out an annoying little scrollbar problem I am having using .NET's C#. I had to place my own scrollbar on a UserControl (because I couldn't figure out how to get them to show up automatically) and now I have to manage the scrollbars manually as well.

What I'm trying to do is pan the image I created somewhere else in the app according to scrollbar position, so I'll take my image and draw it with origin at negative values of scrollbar's values (so that only the relevant part of the image is visible in client area, rest is clipped off the top & left borders).

The vertical scrollbar seems to have problems reaching the exact bottom of my image when I drag the scrollbar thumb tab to the very bottom. It's off by about 9 pixels. I have a onMouseWheel event which modifies the scrollbar positions too and it lines up perfectly with the bottom.

I made a small reference app to demonstrate the problem I am having, try to see the thick red border on the bottom by scrolling down using the vertical scrollbar without the mouse wheel, it's not gonna happen. You only see the red bottom border if you use mouse wheel. Any idea why?

If you notice anything else I am doing wrong please let me know! 😀

 
I haven't looked at your code in depth because I don't have a machine that I can test it on, but isn't there a Scrollable in the regular libraries already that does this?
 
Anyone might know what's going on with this code? the csharp newgroup on Microsoft doesn't seem to be responding either 🙁

It's probably something really stupid I am overlooking but I need another pair of eyes to notice it
 
hi there!

i cant help you with your code because i just started with C# a few months ago. nonetheless, i i can give you a suggestion. whenver you're trying to find the solution for a small code, it's probably better to ask ppl on chat rooms, coz they can look at your code without the need of deep analysis and they give you an answer right away. the MSDN folks might take a while to reply to your post.

if you are familiar with IRC, check out the chat room below. that's the place i go to get my bugful C# codes fixed. 😛

IRC > Dalnet > C#. the URL is irc://dalnet/c%23

once there, they will ask you to post your code somewhere on the web so that they can take a look at it. the site www.pastehere.com is what i use. it's free.

good luck!
 
Back
Top