Automatically scrolling a table upon keypress
-
I need something that will help me do the following: tbxScrollTo will scroll through a somewhat large table (> 3000 entries) when you press a key in said textbox. For example, I type 6 and it will go to the closest entry to '6' (which turns out to be '63,' but I don't want it to go that far. Maybe + or - 10), and if I add '00' then I want it to go to Id '600.' However, if there is no '600' entry, I want it go to the closest one, '603.' I'd really like to do this without buttons, but it's a backup plan. Does anyone have any ideas to help me get started? --------------------------------------------------- If it ain't broke, you're not doing your job!
-
I need something that will help me do the following: tbxScrollTo will scroll through a somewhat large table (> 3000 entries) when you press a key in said textbox. For example, I type 6 and it will go to the closest entry to '6' (which turns out to be '63,' but I don't want it to go that far. Maybe + or - 10), and if I add '00' then I want it to go to Id '600.' However, if there is no '600' entry, I want it go to the closest one, '603.' I'd really like to do this without buttons, but it's a backup plan. Does anyone have any ideas to help me get started? --------------------------------------------------- If it ain't broke, you're not doing your job!
Hi, first a preliminary remark: if your data is line oriented, it makes no sense to me to show it in a TextBox; I would use a ListBox every time, it does not have the overhead of concatenating all the lines, then the pain to find the line beginnings and endings when you need to do something. A listbox contains Items, that can be instances of your own class; or it might just be strings. You can make it "OwnerDrawn", hence you can paint the items any way you like. No sweat. second: what is the problem? you seem to know which line you want to scroll to, so just do it. Of course, a ListBox knows to do that quite easily, with its TopIndex property. Good luck!
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Hi, first a preliminary remark: if your data is line oriented, it makes no sense to me to show it in a TextBox; I would use a ListBox every time, it does not have the overhead of concatenating all the lines, then the pain to find the line beginnings and endings when you need to do something. A listbox contains Items, that can be instances of your own class; or it might just be strings. You can make it "OwnerDrawn", hence you can paint the items any way you like. No sweat. second: what is the problem? you seem to know which line you want to scroll to, so just do it. Of course, a ListBox knows to do that quite easily, with its TopIndex property. Good luck!
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
The first table is 5 columns wide (table 1) and assembled in a hierarchy. I used Janus GridEx 2 (if that matters to anyone). There is another table that is 40,000 lines long (table 2) then another one that is a whimpy 40 lines (table 3). Table 1 is connected to table 2 which is connected to table 3 to form the hierarchy. I use a textbox (actually, Janus EditBox 2) because each individual number that I will be searching is unique. I was figuring that maybe this is possible, but I have found another way to do this. Thanks for the help! If this matters to anyone, I used the filter on the GridEX itself. Thanks again!