468,538 Members | 1,582 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,538 developers. It's quick & easy.

1.Default button runtime 2. App running after unistall

Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India
May 25 '06 #1
3 1323
You might use Process.GetProcessByName to obtain a list of processes having
the same name. If it's existing, sounds like it's running.

"Anil Kumar Sharma" wrote:
Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India

May 25 '06 #2
About your first query, the "default" state of a button is defined at buttons
creation time. Regarding win32 api (CreateWindow - Button Styles), it might
be possible but with some tricks. You can ask a control to recreate himself
(might need to derive the class to access needed method to use SetStyle and
UpdateStyles).

Hope it helps.
"Anil Kumar Sharma" wrote:
Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India

May 25 '06 #3
Hi sebastieng,
Thanks for kind and prompt reply. But you see, when creating installer
in .net build in installer, i cant find a way to code in it (as we do in
install shield). Thats why my application creates a mutex and checks the
other instance of same applicaiton. So my server application wont run twice
in any case. In code i can do this but when insataller of .net is in picture,
its look tough to go through it.
To be straight how can in installer i check for it. For other application
, one can not delete/uninstall the application while its running. But
surprisingly my server application exe can be deleted and hence uninstalled
even when its running.
Thanks again.
Anil

--
Anil Kumar Sharma
(Project Lead)
India
"sebastieng" wrote:
You might use Process.GetProcessByName to obtain a list of processes having
the same name. If it's existing, sounds like it's running.

"Anil Kumar Sharma" wrote:
Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India

May 25 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Bern McCarty | last post: by
1 post views Thread by bruce | last post: by
5 posts views Thread by siggi | last post: by
reply views Thread by =?Utf-8?B?bmVlcmFqYkBub2lkYS5ub3NwYW1oY2x0ZWNoLmNv | last post: by
7 posts views Thread by Norman Diamond | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.