Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - VB - Scrollbar with bigger values?
  
User name:
Password:
Reply:
 

UserPost
HyperLamer
Posts: 1741/8210
I can probably get it to work if VB would just let me add controls. Any idea why that's happening? (See earlier posts.)
Jesper
Posts: 968/2390
All the solutions I've seen here sound hackish and not really well thought-out (it won't work on your neighbor's computer, or it just plain won't make sense). I suggest asking at some more focused "hardcore" VB place, like vbcity.com, whose FAQs rock, by the way.
Squash Monster
Posts: 426/677
You could make a picture box with the background of a scrollbar, two buttons for the arrows, and an image inside the picture box for the bar. Use the drag move, drag drop, and mouse down events of the picture box for scrolling, and the arrow buttons for changing the adress by one.
Lenophis
Posts: 169/830
Well, you COULD do four scroll bars, and each would have 16,384 entries. Or two of 32,768 entries. That or wrack your brain over this mess. That's all I could come up with.
HyperLamer
Posts: 1676/8210
No, but mimicking a scrollbar is a bit harder.
Jraregris
Posts: 18/36
I'm not a VB-expert but to me making a button that does
Address = Address + 1
and a button directly beneath it that does
Address = Address - 1
doesn't sound difficult.
HyperLamer
Posts: 1675/8210
Yeah, that's how I have it now. Address = Scrollbar * 2. It's really hacky though.
I found a replacement scrollbar OCX, but it gives me an error message when I try to add any user controls, including this one and ones I made myself: "Unable to set the version compatible component: [path to .ocx]" So WTF does that mean and how do I fix it?
neotransotaku
Posts: 1445/4016
no, 2 instructions = 1 tick of the the scrollbar, or you can say floor(instruction address / 2) to get the equivalent of the scrollbar. The reason why you are restricted to 16-bits is because the API was first written for 16-bit processing and just has never been updated...

As for replacing the scrollbar, i do not think there is another scrollbar in the windows API. From the literature I've read so far about MFC, you have to do mapping your numbers to 0 - 2^15 range. There is no getting around it...
HyperLamer
Posts: 1674/8210
Er, are you trying to say I should just have it scroll all the way to the bottom, then reset it, and keep my own internal counter? That won't really work too well. Say you wanted to scroll to the bottom, you move it to the bottom and it takes you to the middle. Very confusing.
As for what I'm doing, I have a listbox that shows a disassembly of a byte array (0-65535), one instruction per line. Of course adding 65,536 lines to a listbox would take forever, and this is updated in realtime, so I just show 12 at a time (the most that can fit at once). The scrollbar is used to 'scroll' the listbox (really just changing the starting address), so it needs to be able to start at any address. (Currently, I have it set at 0-32755 (32767-12), and multiply that by 2 to get the address, but that looks really dumb because it will only scroll 2 lines at a time. )

Is there some way to replace the scrollbar? Maybe an API function of some sort? That'd work a lot better. (Or maybe I should just try to make my own. )
neotransotaku
Posts: 1443/4016
what are you trying to do? If i remember scrollbars correctly, scroll bars have a limited range of 0-32767 because of the WinAPI uses a 16-bit value to do scrollbars. So unless you do some extra mapping, say you have that counter and a flag, you can't really improve on it.

i.e.

Larger Range: 0 1 2 3
Smaller Range: 0 0 1 1
Flag: 0 1 0 1
HyperLamer
Posts: 1673/8210
Well I found out that the Scrollbar objects in VB can only have values from 0-32767. I need one that goes 0-65535, how can I do that?
Acmlm's Board - I2 Archive - Programming - VB - Scrollbar with bigger values?


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.022 seconds.