473,395 Members | 1,502 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,395 software developers and data experts.

Pesky parameter problem

I have a dilemma which I'm sure most programmers could solve in their
sleep.

I have two Windows forms, a main window and a smaller window intended
to grab info from the user and send it back to the main window. The
main window's class instantiates the second window's class.

Getting data to the second window and class is no problem: I simply
called a method in the second class instance. However, the method in
the first class that shows the second class/window to the user
obviously terminates long before it can receive anything back from it.
I would like to be able to suspend the first window (that is, so that
the user must close the second winodw to do anything to the first
window) while the second window is open.

I have tried using the ref and out keywords on the parameters in the
second class method, but the method ends with the Show() call and
terminates, which means I cannot use the refs or outs to set the data
when the user clicks OK on the second window.

I know most programs do this simple task, and that it's probably right
under my nose, but I would appreciate any help. Thanks.

S. Knight
se**************@yahoo.com

--

Jun 28 '06 #1
2 1059
Spencer wrote:
I have a dilemma which I'm sure most programmers could solve in their
sleep.

I have two Windows forms, a main window and a smaller window intended
to grab info from the user and send it back to the main window. The
main window's class instantiates the second window's class.

Getting data to the second window and class is no problem: I simply
called a method in the second class instance. However, the method in
the first class that shows the second class/window to the user
obviously terminates long before it can receive anything back from it.
I would like to be able to suspend the first window (that is, so that
the user must close the second winodw to do anything to the first
window) while the second window is open.

I have tried using the ref and out keywords on the parameters in the
second class method, but the method ends with the Show() call and
terminates, which means I cannot use the refs or outs to set the data
when the user clicks OK on the second window.

I know most programs do this simple task, and that it's probably right
under my nose, but I would appreciate any help. Thanks.

S. Knight
se**************@yahoo.com

--


Hi S. Knight,

Have you looked at the ShowDialog() method, which will block until the Form
has been closed? It even returns the value of the DialogResult of the
form, at the time of closing.

--
Hope this helps,
Tom Spink
Jun 28 '06 #2
Great, that worked perfectly! Thanks!

S. Knight

Tom Spink wrote:
Spencer wrote:
I have a dilemma which I'm sure most programmers could solve in
their sleep.

I have two Windows forms, a main window and a smaller window
intended to grab info from the user and send it back to the main
window. The main window's class instantiates the second window's
class.

Getting data to the second window and class is no problem: I simply
called a method in the second class instance. However, the method in
the first class that shows the second class/window to the user
obviously terminates long before it can receive anything back from
it. I would like to be able to suspend the first window (that is,
so that the user must close the second winodw to do anything to the
first window) while the second window is open.

I have tried using the ref and out keywords on the parameters in the
second class method, but the method ends with the Show() call and
terminates, which means I cannot use the refs or outs to set the
data when the user clicks OK on the second window.

I know most programs do this simple task, and that it's probably
right under my nose, but I would appreciate any help. Thanks.

S. Knight
se**************@yahoo.com

--


Hi S. Knight,

Have you looked at the ShowDialog() method, which will block until
the Form has been closed? It even returns the value of the
DialogResult of the form, at the time of closing.


--

Jun 28 '06 #3

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

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
27
by: Codemonkey | last post by:
Heya All, Sorry, but I think it's about time for a monkey-ramble. I've just had enough of trying to serialize even simple objects with VB. A simple task you may think - stick the...
13
by: albert_reade | last post by:
Could someone help me figure out why this error keeps occuring thanks for the help. error: cc FordFulkerson.c FordFulkerson.c:117:2: warning: no newline at end of file Code: #include...
0
by: Billie Boy | last post by:
Hi to all. I’m new here and am coming to you from Melbourne Australia. So a big HELLO 2 ALL. Now I am encountering an annoying problem in the SQL builder of the copy of VB.6 that I am using at...
11
by: Frankie | last post by:
Hello: New user here...first post to group. I'm getting an SQL syntax error when I try to run the following query: $query = sprintf("SELECT itemNumber, entryDate, modifyDate, thumbnailURL,...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
2
by: lesirvin | last post by:
Can some kind sould tell me why i am getting an error message on the rollover links at the top of this page?: http://www.jonimitchell.win-dns.com/musician/ It only happens in IE. Thanks in...
13
by: pbd22 | last post by:
Hi. I have a pesky gap to the right of each of my series of horizontal tabs on the main nav bar of my site. I have tried a number of margin and padding tricks (shown below) and can't seem to get...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.