Click here to Skip to main content
15,919,422 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Read Excel into ado recordset Pin
Quecumber2566-Jul-06 7:54
Quecumber2566-Jul-06 7:54 
QuestionCannot not get bound textbox control to sync with Combobox Pin
Rashar6-Jul-06 6:38
Rashar6-Jul-06 6:38 
AnswerRe: Cannot not get bound textbox control to sync with Combobox Pin
Dave Sexton6-Jul-06 21:28
Dave Sexton6-Jul-06 21:28 
GeneralRe: Cannot not get bound textbox control to sync with Combobox Pin
Rashar7-Jul-06 2:28
Rashar7-Jul-06 2:28 
QuestionDatabase Creation using VB.NET Code Pin
Madni Abbasi6-Jul-06 6:06
Madni Abbasi6-Jul-06 6:06 
AnswerRe: Database Creation using VB.NET Code Pin
Are Jay6-Jul-06 6:14
Are Jay6-Jul-06 6:14 
QuestionCreating two reporting classes Pin
Are Jay6-Jul-06 5:54
Are Jay6-Jul-06 5:54 
Questionhow to tune 2 datagrid scrollbar position? Pin
andreapv6-Jul-06 5:36
andreapv6-Jul-06 5:36 
i have two identical datagrids in my winform:

in one of them i have a vertical scrollbar that has to scoll the datagrids both and put them in the same position

well i can i do it with VS2003

in class mydatagrid
**************************************
ublic Class mydatagrid

Inherits DataGrid

Public Function getPositionScoll() As Integer
Dim pt As New Integer
If Not Me.DataSource Is Nothing Then

pt = Me.VertScrollBar.Value


End If
Return pt
End Function

Public Sub setPositionScoll(ByVal pt As Integer)

If Not Me.DataSource Is Nothing Then

Me.VertScrollBar.Value = pt

End If

End Sub

end class

*************************
in my winform

Private Sub DataGrid1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.Scroll

Dim ttt As Integer = DataGrid1.getPositionScoll()
DataGrid2.setPositionScoll(ttt)

End Sub

and the datagrid2 does not move



SECOND TRY

in class mydatagrid
**************************************
ublic Class mydatagrid

Inherits DataGrid
Sub ScrollToRow(ByVal row As Integer)

If Not Me.DataSource Is Nothing Then

Me.GridVScrolled(Me, New ScrollEventArgs(ScrollEventType.LargeIncrement, row))

End If

End Sub

end class


*************

in my winform

Private Sub DataGrid1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.Scroll

DataGrid2.ScrollToRow( an integer that you want)


End Sub

**********

now datagrid1's scrollbar moves datagrid2 to the the row but it moves only at that row...


the idea is in the scroll mathod event get the point of the scroll and than take the number of the first visible row of the datagrid1 and give it to DataGrid2.ScrollToRow:

For Each c As Control In DataGrid1.Controls

If c.GetType() Is GetType(VScrollBar) Then
pt = VScrollBar.MousePosition()
End If
Next

using pt point can i do what i want????
is this the right way to do it????
are there other ways to tune the position of my two datagrid with scroll????






QuestionLoad svg image into picturebox Pin
szevy_suez6-Jul-06 4:48
szevy_suez6-Jul-06 4:48 
QuestionCreating setup for application including ODBC Pin
Member 22716556-Jul-06 4:09
Member 22716556-Jul-06 4:09 
QuestionCreate an Object by Name Pin
mdsffm6-Jul-06 3:06
mdsffm6-Jul-06 3:06 
AnswerRe: Create an Object by Name Pin
Guffa6-Jul-06 6:42
Guffa6-Jul-06 6:42 
QuestionAccessing Database Pin
Rizwan Rathore6-Jul-06 2:45
Rizwan Rathore6-Jul-06 2:45 
AnswerRe: Accessing Database Pin
Dave Sexton6-Jul-06 4:41
Dave Sexton6-Jul-06 4:41 
GeneralRe: Accessing Database Pin
Rizwan Rathore6-Jul-06 11:47
Rizwan Rathore6-Jul-06 11:47 
QuestionMS Project API Pin
Sufyan_shani6-Jul-06 2:22
Sufyan_shani6-Jul-06 2:22 
Questionplease help me Pin
avinashprabhu.t.p6-Jul-06 1:37
avinashprabhu.t.p6-Jul-06 1:37 
AnswerRe: please help me Pin
Sufyan_shani6-Jul-06 3:16
Sufyan_shani6-Jul-06 3:16 
AnswerRe: please help me Pin
Guffa6-Jul-06 6:45
Guffa6-Jul-06 6:45 
QuestionCannot find keycodev2.dll or invalid keycode Pin
khwo5-Jul-06 22:32
khwo5-Jul-06 22:32 
AnswerRe: Cannot find keycodev2.dll or invalid keycode Pin
Dave Sexton6-Jul-06 4:26
Dave Sexton6-Jul-06 4:26 
GeneralRe: Cannot find keycodev2.dll or invalid keycode Pin
khwo6-Jul-06 17:15
khwo6-Jul-06 17:15 
GeneralRe: Cannot find keycodev2.dll or invalid keycode Pin
Dave Sexton6-Jul-06 19:51
Dave Sexton6-Jul-06 19:51 
GeneralRe: Cannot find keycodev2.dll or invalid keycode Pin
khwo6-Jul-06 20:42
khwo6-Jul-06 20:42 
GeneralRe: Cannot find keycodev2.dll or invalid keycode Pin
Dave Sexton6-Jul-06 21:21
Dave Sexton6-Jul-06 21:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.