Click here to Skip to main content
15,891,375 members
Home / Discussions / C#
   

C#

 
AnswerRe: ShowDialog not displaying form. Pin
BillWoodruff14-Dec-11 22:03
professionalBillWoodruff14-Dec-11 22:03 
QuestionError 1067 C# windows service Pin
eyesark14-Dec-11 4:07
eyesark14-Dec-11 4:07 
AnswerRe: Error 1067 C# windows service Pin
PIEBALDconsult14-Dec-11 4:34
mvePIEBALDconsult14-Dec-11 4:34 
AnswerRe: Error 1067 C# windows service Pin
Richard MacCutchan14-Dec-11 5:58
mveRichard MacCutchan14-Dec-11 5:58 
AnswerRe: Error 1067 C# windows service Pin
jschell14-Dec-11 9:18
jschell14-Dec-11 9:18 
AnswerRe: Error 1067 C# windows service Pin
Pete O'Hanlon14-Dec-11 11:22
mvePete O'Hanlon14-Dec-11 11:22 
QuestionRun the application once Pin
sarang_k14-Dec-11 3:07
sarang_k14-Dec-11 3:07 
AnswerRe: Run the application once PinPopular
Wayne Gaylard14-Dec-11 3:26
professionalWayne Gaylard14-Dec-11 3:26 
You should run your app using the Mutex class, something like this:-

C#
bool isNew = true;
using (Mutex mutex = new Mutex(true, "yourAppName", out isNew))
{
    if (isNew)
    {
        Application.Run(new MainForm());
    }
}


If the app is aplready running and you would like it to be given focus you need to use a Win32 API method called SetForegroundWindow which I'm sure you could find an instance of on Google.

Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

GeneralRe: Run the application once Pin
BobJanova14-Dec-11 3:43
BobJanova14-Dec-11 3:43 
GeneralRe: Run the application once Pin
Wayne Gaylard14-Dec-11 3:52
professionalWayne Gaylard14-Dec-11 3:52 
AnswerRe: Run the application once Pin
thatraja14-Dec-11 4:23
professionalthatraja14-Dec-11 4:23 
AnswerRe: Run the application once Pin
Luc Pattyn14-Dec-11 9:26
sitebuilderLuc Pattyn14-Dec-11 9:26 
GeneralRe: Run the application once Pin
BillWoodruff14-Dec-11 22:13
professionalBillWoodruff14-Dec-11 22:13 
GeneralRe: Run the application once Pin
Pete O'Hanlon14-Dec-11 22:15
mvePete O'Hanlon14-Dec-11 22:15 
AnswerRe: Run the application once Pin
BillWoodruff14-Dec-11 22:13
professionalBillWoodruff14-Dec-11 22:13 
QuestionUse the environment provided by the application instead from system environment. Pin
Member 848801414-Dec-11 1:35
Member 848801414-Dec-11 1:35 
AnswerRe: Use the environment provided by the application instead from system environment. Pin
PIEBALDconsult14-Dec-11 1:45
mvePIEBALDconsult14-Dec-11 1:45 
SuggestionRe: Use the environment provided by the application instead from system environment. Pin
Shameel14-Dec-11 2:02
professionalShameel14-Dec-11 2:02 
QuestionDisplay a menu in context menu Pin
sarang_k14-Dec-11 0:00
sarang_k14-Dec-11 0:00 
AnswerRe: Display a menu in context menu Pin
BillWoodruff14-Dec-11 2:48
professionalBillWoodruff14-Dec-11 2:48 
QuestionHow I can Show the Value of Textbox in another form in C sharp? Pin
ishaq shinwari13-Dec-11 21:25
ishaq shinwari13-Dec-11 21:25 
AnswerRe: How I can Show the Value of Textbox in another form in C sharp? Pin
Pete O'Hanlon13-Dec-11 21:37
mvePete O'Hanlon13-Dec-11 21:37 
GeneralRe: How I can Show the Value of Textbox in another form in C sharp? Pin
ishaq shinwari13-Dec-11 22:26
ishaq shinwari13-Dec-11 22:26 
GeneralRe: How I can Show the Value of Textbox in another form in C sharp? Pin
Pete O'Hanlon13-Dec-11 23:01
mvePete O'Hanlon13-Dec-11 23:01 
AnswerRe: How I can Show the Value of Textbox in another form in C sharp? Pin
Varun Sareen13-Dec-11 23:12
Varun Sareen13-Dec-11 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.