473,407 Members | 2,359 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,407 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 1707
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.