|
When I open Form2, I want main form to be completely destroyed but in your code it doesn't get destroyed too.
A thread is working in main form and it keeps doing what it does after the main form is closed and form2 is shown. I don't want main windows to keep doing anything.
|
|
|
|
|
SimpleData wrote: A thread is working in main form
That does not make sense. A thread does not live inside a Form, a thread is a piece of code, any code, executing on a processor, and a Form is a GUI component. Maybe your Form class created and started the thread, destroying the Form would not stop such a thread, unless you do it explicitly in a destructor/finalizer but I doubt very much that is what you are doing.
If you want a thread to stop doing what it does, then tell it to stop by setting some flag, and have the thread check that flag regularly. Killing/aborting a thread the hard way isn't a very good idea.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
How can I set a flag and then stop that thread with a destructor/finalizer?
|
|
|
|
|
you don't need a destructor/finalizer to stop a thread.
Here is a pseudo-code example:
Thread thread;
bool cancel;
void start_Clicked() {
cancel=false;
thread==new Thread(...threadCode);
thread.Start();
}
void stop_Clicked() {
cancel=true;
}
void threadCode() {
while(!cancel) {
.. do something useful
}
}
thas is cooperative thread control: the thread is doing some of the controlability work itself (the while test)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thank you for your answer, I really need to make some structural changes on my code
|
|
|
|
|
Hai
I want to connect the remote server from my LAN computer becoz to access the database in the remote server through C# code.
plz give me some useful ideas and examples in C#
|
|
|
|
|
Just set the data source in the connection string as the name/IP of the computer where database is. Connection string can be found here[^].
|
|
|
|
|
|
Hi,
I have a problem with my WebBrowser:
I can't get the full HTML code!
I only get redirects to the frame's, but i need the code in it!
I can't go to the url, because for some reason, the page is empty then!
Please help me!
Martijn.
BTW. Sorry, i'm dutch, i can't speak very well english
|
|
|
|
|
Your english seems fine, I'm just having trouble seeing the relevance of the question to a C# forum or programming in general.
Who's html code, yours or another site. Some detail of what you are trying to achieve may be useful.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
I have a c# application & i want to install this application in the drive where the operating system is currently installed..................... can you tell me the code just to know in which drive is the operating system installed(like 'C','D')..............then i will work it out..
Thank you
|
|
|
|
|
Hi,
there are many ways to get such information.
One is by looking at some of the environment variables (e.g. WINDIR).
An easier one is using Environment.GetFolderPath(SpecialFolder.System)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks muchness Luc.
|
|
|
|
|
all of you are welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I wonder if you are helping 2 people with the identical problem, or the guys schitsophrenic and can't decide which identity to use!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
2? its much more complex, you don't want to know, trust me.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Ok dude.............i will try it
|
|
|
|
|
I have made an application in c# and I also have a flash file(xx.swf) .............. and i want this flash movie to be displayed as an Splash screen.......................................... so can you help me how to do that?
Thank Y0u
|
|
|
|
|
Seems to be plenty of resources[^] out there for this question
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Use Shock Wave Flash Object we can play the .swf file in our application.
Right Click the Tool Box-> Choose Items->COM Components->Shock Wave Flash Object.
Now control add on your tool box, click and drag the control and give the Movie URL and Base URL.
Movie URL - *.swf;
Base URL - *.fla.(Base URL is Optional)
---- Vasanth.A
|
|
|
|
|
oh .... good one ... i will check it out ...... but one my friend here gave me resources on how to get them ..................... but there are 2 *.dll files (ShockwaveFlash and AxShcokwaveFlash) ............ but I cant find the 2nd one but it is really hard form me to play them using the first dll ...... any ways i will keep on trying
Thank you...
|
|
|
|
|
Hey man ............... thats what am talking about ....................... you got it ...................... thanks for your help .......................
I was finding such kind of man for weeks .... and that is cool .......
|
|
|
|
|
it ok man i sent what i know. you are welcome
|
|
|
|
|
I doesn't work in my computer.When i want to add it on the form it give me an error message(You must register this commponet).Thank u.
CanI
|
|
|
|