2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
In order to highlight the particular cell position in vertical scrollbar, the Paint event can be used. The position should be calculated as per the below code, Code Snippet C# // Highlight the current cell position. this.scrollersFrame1.VerticalScroller.Paint += VerticalScroller_Paint; void VerticalScroller_Paint(object sender, PaintEventArgs e) { height = this.gridControl1.DefaultRowHeight * rowIndex; y = height < view ? 0 : (height / view); y = y * (view / part); y = y + (height % view)/part; DrawRect(e.ClipRectangle); } //Draw the rectangle on vertical scroll bar. private void DrawRect(Rectangle rect) { renderer.rect = new Rectangle(rect.X, y, rect.Width, 3); }
VB ‘Highlight the current cell position. AddHandler Me.scrollersFrame1.VerticalScroller.Paint, AddressOf VerticalScroller_Paint Private Sub VerticalScroller_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) height_Renamed = Me.gridControl1.DefaultRowHeight * rowIndex y = If(height_Renamed < view, 0, (height_Renamed / view)) y = y * (view \ part) y = y + (height_Renamed Mod view)/part DrawRect(e.ClipRectangle) End Sub ‘Draw the rectangle on vertical scroll bar. Private Sub DrawRect(ByVal rect As Rectangle) renderer.rect = New Rectangle(rect.X, y, rect.Width, 3) End Sub
Screenshot Sample Links
|
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.