TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manuel Osorio
NA
2
1.9k
How to pass a row of a datagriview to another form controls?
Mar 4 2016 1:11 PM
I have a Main Form(MDI)that Opens a form with a button(search) and controls.This button opens a Form 2 with a datagridview.
I need to pass a row of datagridview that is in Form 2 to Form 1 controls.
I open my form 1 :
Dim
f1
As
New
form1
f1.MdiParent=
Me
f1.Show()
I open my form 2 (search button):
Dim
f2
As
New
form2
f2.ShowDialog()
f2.Dispose()
Form2 has a datagridview and I use the event CellContentDobleClick:
Private
Sub
dgv1_CellContentDoubleClick(sender
As
Object
, e
As
DataGridViewCellEventArgs)
Handles
dgv1.CellContentDoubleClick
If
(e.RowIndex = -1)
Then
Return
End
If
Dim
dr
As
DataGridViewRow = dgv1.SelectedRows(0)
Me
.Hide()
form1.Show()
form1.txtID.Text = dr.Cells(0).Value.ToString()
form1.txtNo.Text = dr.Cells(1).Value.ToString()
End
Sub
I think that I have to access to the instance, but I don't Know How to do it. I need a simple explanation and example. Please
Thank you!!
Reply
Answers (
1
)
what is the code that is use to develop Data Organizer
Create custom function in excel