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

How to make a "Modal Object" ?


How can I make a "ModalObject" that will react like a ModalForm ? I mean an object that will run in it's own message loop and return a value (a string value) when closed.



Example :



private void SomeFunction()

{

ModalObject modalObject = new ModalObject();

If (modalObject.Execute = "OK")

{

//Do some code.

}

}



Thanks For any help !!



Steph.

Nov 17 '05 #1
2 1656

Steph. schreef:
How can I make a "ModalObject" that will react like a ModalForm ? I mean an object that will run in it's own message loop and return a value (a string value) when closed.

Example :

private void SomeFunction()

{

ModalObject modalObject = new ModalObject();

If (modalObject.Execute = "OK")

{

//Do some code.

}

}

Thanks For any help !!

Steph.

Maybe this help.
I didn't test it.

private string _returnMessage;
private bool _closing=false;

public string Execute()
{
while (!_closing)
{
//do nothing
//sleep
}

return _returnMessage;
}

private void Form1_Closing(object sender, CancelEventArgs e)
{
// set message
// set _closing variable to true
_closing=true;
}

Maybe you can also use the closed event.

Nov 17 '05 #2
"Steph." <st***@nomail.com> wrote in message
news:uy*************@TK2MSFTNGP12.phx.gbl...
How can I make a "ModalObject" that will react like a ModalForm ? I mean
an object that will run in it's
own message loop and return a value (a string value) when closed.


Sounds like you're talking about a singleton...
http://www.google.com/search?sourcei...3%22+singleton
Nov 17 '05 #3

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

Similar topics

4
by: Hitesh Bhatiya | last post by:
Hi all, I have written a small program to accept some socket connections, which are then added to a vector (using push_back). But after a few calls to the push_back function, it deleted the...
22
by: Dr Duck | last post by:
GDay all, Something seems odd to me.... I wrote a simple C# function public void bind(ref object a, ref object b, bool atob) { if(atob) b = a; else
2
by: brazilnut52 | last post by:
I am going to outline the steps I go through to produce the problem. Hopefully this will help you understand the problem better I have created a simple COM DLL in .NET by using the COM class...
3
by: muesliflakes | last post by:
I come from Java and an Object would be the class whist object would likly be the varible to an object. I get the impression with C# that object is just an alias to the Base Class Object. Can...
5
by: Robin Tucker | last post by:
Hiya, I'm using mshtml and the web browser control to embed an OLE object in my ..NET application. What I want to do is get a reference to the "object" embedded therein: The HTML looks...
14
by: I_AM_DON_AND_YOU? | last post by:
Hello all: Yesterday I put this post regarding the query as to how to open a new form in "modal" style. I am calling the form in the following way: dim frm as form2() frm = new form2()...
35
by: Chris | last post by:
Hi, I tried to create a class which must change the propety 'visible' of a <linktag in the masterpage into 'false' when the user is logged. But i get the error: "Object reference not set to an...
3
by: frosted74 | last post by:
Hi, I have 2 javascript functions, one that sorts a table and one that shows/hides a modal dialog that displays something like "Sorting" with a little icon indicating that the browser is "busy"...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.