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. Scrollbar height and width

Scrollbar height and width

Scheduled Pinned Locked Moved Visual Basic
question
5 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.
  • R Offline
    R Offline
    r ps
    wrote on last edited by
    #1

    Hi, Forgive me if this is a silly question. I'm new to this. How can one find out the height and width of the scrollbars of a treeview control? I have a treeview which i'm trying to resize when the form is resized. I'm doing this;

    Me.TreeView1.Height = Me.ClientSize.Height - x

    I need to figure out 'x' so that the scrollbar stays inside the form!

    D 1 Reply Last reply
    0
    • R r ps

      Hi, Forgive me if this is a silly question. I'm new to this. How can one find out the height and width of the scrollbars of a treeview control? I have a treeview which i'm trying to resize when the form is resized. I'm doing this;

      Me.TreeView1.Height = Me.ClientSize.Height - x

      I need to figure out 'x' so that the scrollbar stays inside the form!

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      You should make sure the treeview stays inside the form. The scrollbar will follow automatically. Appropriate anchoring and docking will do that for you.

      The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद

      R 1 Reply Last reply
      0
      • D dan sh

        You should make sure the treeview stays inside the form. The scrollbar will follow automatically. Appropriate anchoring and docking will do that for you.

        The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद

        R Offline
        R Offline
        r ps
        wrote on last edited by
        #3

        d@nish wrote:

        You should make sure the treeview stays inside the form

        That is what i was trying to do with the piece of code i'd posted. But unless i subtract a certain value (which i assume is the height of scrollbar), the treeview's scrollbar strays out of the form! interestingly if i simply use the docking property (Fill), the resizing works fine but the scrollbar is never shown. hence my attempt to do it manually.

        D 1 Reply Last reply
        0
        • R r ps

          d@nish wrote:

          You should make sure the treeview stays inside the form

          That is what i was trying to do with the piece of code i'd posted. But unless i subtract a certain value (which i assume is the height of scrollbar), the treeview's scrollbar strays out of the form! interestingly if i simply use the docking property (Fill), the resizing works fine but the scrollbar is never shown. hence my attempt to do it manually.

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          Assuming the treeview is in the left part of the form along the height, anchor it to top, left and bottom. Also make sure scrollable property is true.

          The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद

          R 1 Reply Last reply
          0
          • D dan sh

            Assuming the treeview is in the left part of the form along the height, anchor it to top, left and bottom. Also make sure scrollable property is true.

            The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद

            R Offline
            R Offline
            r ps
            wrote on last edited by
            #5

            Thanks d@nish. Got it to work. I had to delete the original treeview and add a new one. I must have messed-up some other property.

            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