472,958 Members | 2,358 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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 1514
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Naresh | last post by:
I have Windows 2000 advanced server with SP4 installed. I also have Biztalk Server 2004 installed. I am using VS.NET 2003. I create any class library without setting any additional external...
2
by: MLH | last post by:
I would like to allow users to set, as an application default, a specific printer to send reports to. I don't know how to bring up a list of valid print devices in A97, nor do I know how to...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
1
by: bruce | last post by:
hi.. i'm trying to figure out how to uninstall "mechanize". i don't see an "unistall" from the "python --help-commands" function... i'm looking to rebuild/reinstall mechanize from the svn...
5
by: siggi | last post by:
Hi all, installing a package with 'setup.py' is easy. But how do I uninstall the package, once I want to get rid of it again? Thanks, siggi
0
by: =?Utf-8?B?bmVlcmFqYkBub2lkYS5ub3NwYW1oY2x0ZWNoLmNv | last post by:
Hi, We have created new .NET web service and running it through the default test page and it's working fine in our development environment. When we moved the web service to the acceptance...
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
0
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.