473,379 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

howto interact with a control on the parent form

Hi,
I have an vb6 app that I want to port to .net. I tried the wizard but it
doesn't convert it all. In my app I have a form with a datagrid on it. If a
user doubleclicks on a row a form is shown (modal) with details (and some
more info) about the selected row. Under vb6 it's quite easy to select
another row, through code, in de datagrid without closing the detailform. How
can this be done in .net?

Thanks,
Frank
Nov 21 '05 #1
2 1704
Frank wrote:
Hi,
I have an vb6 app that I want to port to .net. I tried the wizard but it
doesn't convert it all. In my app I have a form with a datagrid on it. If a
user doubleclicks on a row a form is shown (modal) with details (and some
more info) about the selected row. Under vb6 it's quite easy to select
another row, through code, in de datagrid without closing the detailform. How
can this be done in .net?

Thanks,
Frank


There are many ways...
- Pass a reference to the datagrid into the child form
- Pass a reference of the parent form and open a property to change the
row.
- Invoke a delegate on the parent form

example:

public class ChildForm

private refToDataGrid as DataGrid
public shadows sub ShowDialog(ParentDataGrid as DataGrid)
refToDataGrid = ParentDataGrid
mybase.showdialog
end sub

Sub MoveDataGridRow()
refToDataGrid.CurrentRowIndex = newRow
end sub
End Class

public class parentForm

public sub OpenChildForm
dim C as new ChildForm
C.ShowDialog(C)
end sub
end class
Nov 21 '05 #2
Frank wrote:
Hi,
I have an vb6 app that I want to port to .net. I tried the wizard but it
doesn't convert it all. In my app I have a form with a datagrid on it. If a
user doubleclicks on a row a form is shown (modal) with details (and some
more info) about the selected row. Under vb6 it's quite easy to select
another row, through code, in de datagrid without closing the detailform. How
can this be done in .net?

Thanks,
Frank


There are many ways...
- Pass a reference to the datagrid into the child form
- Pass a reference of the parent form and open a property to change the
row.
- Invoke a delegate on the parent form

example:

public class ChildForm

private refToDataGrid as DataGrid
public shadows sub ShowDialog(ParentDataGrid as DataGrid)
refToDataGrid = ParentDataGrid
mybase.showdialog
end sub

Sub MoveDataGridRow()
refToDataGrid.CurrentRowIndex = newRow
end sub
End Class

public class parentForm

public sub OpenChildForm
dim C as new ChildForm
C.ShowDialog(C)
end sub
end class
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: deko | last post by:
I'm hoping someone can sanity check my understanding of the Object Model for Forms/Controls. I'm having trouble drilling down into Control properties. First, I have a record set with the...
7
by: vindaloo1 | last post by:
I'm using Access 2000 and I have a main form and a subform. When a control on the subform is updated I am trying to update a control on the mainform. But instead of updating the control on the...
11
by: Sagaert Johan | last post by:
I have made a custom control that draws a rectangle when the mouse is down, and does nothing when the mouse is up. I set/reset a flag in MouseDown/Mouse up and use this to do the drawing in the...
2
by: Mystery Man | last post by:
I have developed a series of user defined controls. These have been placed on a variety of different forms. From within one of these controls, I want to show another dialog directly to the right...
2
by: Levis | last post by:
Hi, I inherited Button and I created my component (MyButton) In this button onclick event I want show this objects parent form. When my form is not MDIChild this codes run correct. But when my...
6
by: Art | last post by:
Hi I'm new at this and need some help. I have a "solution" with 2 projects - the main project and a library. The library is simple, it contains a text box that will appear many times in the form...
0
by: Dan Sikorsky | last post by:
How do you act on a user control's (.ascx) button click event in the containing page (.aspx) ? Should event bubbling be considered? Does this even make sense to try and do? Should the user...
0
by: Frank | last post by:
Hi, I have an vb6 app that I want to port to .net. I tried the wizard but it doesn't convert it all. In my app I have a form with a datagrid on it. If a user doubleclicks on a row a form is shown...
4
by: gsb58 | last post by:
Hi! On a form I have a calendar. The form is rezised to 1024x768 (Don't worry - this is a training case) when loaded. Now I want to center the calendar on the form so that its edges are...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.