Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Automatically scrolling a table upon keypress

Automatically scrolling a table upon keypress

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestioncareer
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Drew
    wrote on last edited by
    #1

    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!

    L 1 Reply Last reply
    0
    • D Drew

      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!

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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] }


      D 1 Reply Last reply
      0
      • L Luc Pattyn

        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] }


        D Offline
        D Offline
        Drew
        wrote on last edited by
        #3

        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!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups