|
Angel1058 wrote: 'Close()'. Does that destroy the window?
If you mean will secondform be a null pointer after it's called, then no. Close() disposes the form and it's contents, and destroys it's window handle, but comparing secondform to null (like you're doing in your OnClickEvent() method) will return false.
You can use the IsDisposed property of the Form to check to see if the form has been disposed, and that should work (but you'd have to check if it's null first)...
if ( secondform == null || secondform.IsDisposed )
secondform = new MyForm(data_for_form_listbox) Hope that helps
“Accept that some days you are the pigeon, and some days you are the statue” -- David Brent
Cheers,
Will H
|
|
|
|
|
secondform.IsDisposed That's what I was missing - many thanks. Amazing, I've used MFC/VC++ for years and years and yet couldn't even successfully close and reopen a form in C#....doh.
Thanks again.
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Can we still drag and drop shape onto the form?
I want to draw 8 circles (names Circle) and each one is in an array (Circle #1 = Circle[0]).
How can we do that?
Thank you
Donkaiser
|
|
|
|
|
hi there !
I wrote the following Function , Like this :
private int YourNo(int Number)
{
...
Number=(X+Y)*100;
return Number;
}
I want to use of this function(the value of Number parameter) in this Event :
private void calculate_Click((object sender, EventArgs e)<br />
{<br />
txtNumber.Text=....?<br />
}
in txtNumber.Text I want to put the value of returning function(Number).
How can i use it(Number parameter) ?
thanks a lot
regards,
s_mostafa_h
-- modified at 16:18 Wednesday 14th June, 2006
|
|
|
|
|
Try this:
txtNumber.Text=YourNo(Number).ToString();
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
hi !
it doesn't work . did you test it ?
Regards ,
s_mostafa_h
|
|
|
|
|
No sorry,
It was an idea
What error message you get?
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
The code that Elina suggested is basically correct. What you have to do is just substitute the "Number" with the value you want to send into the function.
What do you mean by "doesn't work", really? What happens? Do you get an error message?
What does the "..." in the function represent? Do you use the value of the parameter at all?
---
b { font-weight: normal; }
|
|
|
|
|
private int YourNo(int Number)<br />
{<br />
int x = 10;<br />
int y = 5;<br />
Number=(X+Y)*100;<br />
return Number;<br />
}<br />
<br />
<br />
<br />
private void calculate_Click((object sender, EventArgs e)<br />
{<br />
txtNumber.Text= YourNo(Convert.ToInt32(txtNumber.Text)).ToString();<br />
}
|
|
|
|
|
hi there !
thnks for ur reply !
albCode wrote: txtNumber.Text= YourNo(Convert.ToInt32(txtNumber.Text)).ToString();
Why "YourNo(Convert.ToInt32(txtNumber.Text))..." ? , I want to use of "Number Parameter " , when I clicked the button ,
Regards ,
s_mostafa_h
|
|
|
|
|
mostafa_h wrote: Why "YourNo(Convert.ToInt32(txtNumber.Text))..." ?
txtNumber.Text is parameter which u give in YourNo
|
|
|
|
|
but I want to use the return Value "Number" in Event .
txtNumber.Text= YourNo(Number).ToString();
but I have this Error message :
the name 'Number' doesn't exist in the current context .
Regards ,
s_mostafa_h
|
|
|
|
|
the problem was solved as following :
private int YourNo(out int Number)
{
...
Number=(X+Y)*100;
return Number;
}
and :
private void calculate_Click((object sender, EventArgs e)
{
int output;
YourNo(out output);
txtNumber.Text=output.ToString();
}
Regards ,
s_mostafa_h
|
|
|
|
|
Hello i have a C# program which loads a excel file and read its contents. I want to know how can my program be notified if some one modifies the file i am using so that i get the new data. I can handle events for excel object which opened through my program but what if some other user opens the files and modifies and i want that notification. Is there way i can send a remoting message from excel event handlers to C# application?. If so any help or code snippets will be great help
venky
|
|
|
|
|
Why don't you just use a FileSystemWatcher to watch files in that directory?
Logifusion[^]
|
|
|
|
|
well,i can try that but is there any other way? Is there a way to send a remoting call from Excel event handlers?
|
|
|
|
|
what should i do to make my label accepting multiple line of text.
I remember in vb5 we can resize the label the way we want to and the text will wrap automatically too.
Donkaiser
|
|
|
|
|
set autosize to false
Donkaiser
|
|
|
|
|
Hey, I know there is suppose to be a class System.Runtime.Serialization.Formatters.SOAP.SoapFormatter
but I don't even have the namespace System.Runtime.Serialization.Formatters.SOAP, what's the problem?
NaNg.
|
|
|
|
|
You need to reference a separate assembly, with a name like System.Runtime.Serialization.Formatters.SOAP
Josh
|
|
|
|
|
|
Is there any way possible to post a small icon in a cell when your view property on your listview is set to "details". I was trying to highlight my cells but the color doesn't hold when i scroll over it or select it(it reverts back to white) so I thought maybe i could just add an icon.
|
|
|
|
|
|
lulu0441 wrote: do it in C++
You posted this same question in three different forums. Why? It's clearly a homework assignment to be done in C++.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Can you do it in any ways ?
|
|
|
|