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 Studio
  4. How to Increse width of Vertical ScrollBar

How to Increse width of Vertical ScrollBar

Scheduled Pinned Locked Moved Visual Studio
csharpvisual-studiotutorialquestion
3 Posts 3 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.
  • A Offline
    A Offline
    Amol_B
    wrote on last edited by
    #1

    Hello, Is there any way that one can increse width of a Vertical ScrollBar of DataGridView in Visual Studio 2005 ? This feature was there in Visual Studio .NET 2003. Code from VS 2003 :

    If grd.Controls(1).Width < 28 Then
    grd.Controls(1).Width += increaseWidth
    End If

    but it wont work in VS 2005. Looking forward to Reply. Thanking you in advance.

    J 1 Reply Last reply
    0
    • A Amol_B

      Hello, Is there any way that one can increse width of a Vertical ScrollBar of DataGridView in Visual Studio 2005 ? This feature was there in Visual Studio .NET 2003. Code from VS 2003 :

      If grd.Controls(1).Width < 28 Then
      grd.Controls(1).Width += increaseWidth
      End If

      but it wont work in VS 2005. Looking forward to Reply. Thanking you in advance.

      J Offline
      J Offline
      John Ad
      wrote on last edited by
      #2

      Hi, Try the following code: _______________________________________________________________________________ Public Class CustomDataGrid Inherits DataGrid Public Sub New() ' make scrollbar visible & add handler VertScrollBar.Visible = True AddHandler VertScrollBar.VisibleChanged, AddressOf ShowScrollBars End Sub Private ReadOnly CAPTIONHEIGHT As Integer = 21 Private ReadOnly BORDERWIDTH As Integer = 2 Private Sub ShowScrollBars(ByVal sender As Object, ByVal e As EventArgs) If Not VertScrollBar.Visible Then Dim width As Integer = VertScrollBar.Width VertScrollBar.Location = _ New Point(ClientRectangle.Width - width - BORDERWIDTH, CAPTIONHEIGHT) VertScrollBar.Size = _ New Size(width, ClientRectangle.Height - CAPTIONHEIGHT - BORDERWIDTH) VertScrollBar.Show() End If End Sub End Class _______________________________________________________________________________ I hope this would be helpful.

      Vinay ComponentOne LLC. www.componentone.com

      M 1 Reply Last reply
      0
      • J John Ad

        Hi, Try the following code: _______________________________________________________________________________ Public Class CustomDataGrid Inherits DataGrid Public Sub New() ' make scrollbar visible & add handler VertScrollBar.Visible = True AddHandler VertScrollBar.VisibleChanged, AddressOf ShowScrollBars End Sub Private ReadOnly CAPTIONHEIGHT As Integer = 21 Private ReadOnly BORDERWIDTH As Integer = 2 Private Sub ShowScrollBars(ByVal sender As Object, ByVal e As EventArgs) If Not VertScrollBar.Visible Then Dim width As Integer = VertScrollBar.Width VertScrollBar.Location = _ New Point(ClientRectangle.Width - width - BORDERWIDTH, CAPTIONHEIGHT) VertScrollBar.Size = _ New Size(width, ClientRectangle.Height - CAPTIONHEIGHT - BORDERWIDTH) VertScrollBar.Show() End If End Sub End Class _______________________________________________________________________________ I hope this would be helpful.

        Vinay ComponentOne LLC. www.componentone.com

        M Offline
        M Offline
        Milind Bhadane
        wrote on last edited by
        #3

        Hello Vinay, I am having the same problem. I can increse the width of Datagrid Vertical Scrollbar in VS.NET 2003. But now in VS.NET 2005, I want to use DataGridView and it does not support the same code of .NET 2003. Code of .NET 2003 is as follows: If grd.Controls(1).Width < 28 Then grd.Controls(1).Width = 30 End If Also, in the code provided by you, You used "Inherits DataGrid" not DataGridview. So, I just wanted to know that will it work for Datagridview. Looking forward to your reply. Thanking You.

        - Milind Bhadane. Sr. Software Developer.

        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