Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
QuestionI want to show my GPS cursor in Mapwingis, how to do it? Pin
Member 1241411416-Jun-16 3:55
Member 1241411416-Jun-16 3:55 
AnswerRe: I want to show my GPS cursor in Mapwingis, how to do it? Pin
Pete O'Hanlon16-Jun-16 21:40
mvePete O'Hanlon16-Jun-16 21:40 
GeneralRe: I want to show my GPS cursor in Mapwingis, how to do it? Pin
Member 1241411416-Jun-16 22:32
Member 1241411416-Jun-16 22:32 
GeneralRe: I want to show my GPS cursor in Mapwingis, how to do it? Pin
Pete O'Hanlon16-Jun-16 22:37
mvePete O'Hanlon16-Jun-16 22:37 
GeneralRe: I want to show my GPS cursor in Mapwingis, how to do it? Pin
Member 1241411416-Jun-16 22:40
Member 1241411416-Jun-16 22:40 
GeneralRe: I want to show my GPS cursor in Mapwingis, how to do it? Pin
Pete O'Hanlon16-Jun-16 22:45
mvePete O'Hanlon16-Jun-16 22:45 
QuestionHow to find out, if the toolbar icon or the notifyicon is clicked Pin
Member 1191673515-Jun-16 19:26
Member 1191673515-Jun-16 19:26 
AnswerRe: How to find out, if the toolbar icon or the notifyicon is clicked Pin
OriginalGriff15-Jun-16 20:22
mveOriginalGriff15-Jun-16 20:22 
You can't, without playing some very nasty games with DoEvents.
The problem is that unless you are explicitly threading your app, the while loop is executing on the same thread as the rest of the UI elements - so the click action won't get honoured until after the loop has finished and the event handler that started it has returned control to the system.
It's like a man who is so busy concentrating on what's in front of him while he is driving, that he doesn't notice the fire engine trying to get past!

You can do it, but you have to change the way your application works, and move the loop into a separate thread. You can then set up an "terminate" variable which you check in the loop, and set in the Click event handler. Have a look at the BackgroundWorker Class (System.ComponentModel)[^] - it provides a safe and easy way to do this, but be aware that you cannot access any UI elements except on the same thread they were created on - if you try to do that inside your loop using a BackgroundWorker you will get a "Cross thread exception" and that means you need to use Invoke to move the access back onto the original thread. This isn't a simple subject and it's probably an idea if you do some background reading on Threading first before you get too complicated.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: How to find out, if the toolbar icon or the notifyicon is clicked Pin
Member 1191673515-Jun-16 22:50
Member 1191673515-Jun-16 22:50 
GeneralRe: How to find out, if the toolbar icon or the notifyicon is clicked Pin
OriginalGriff15-Jun-16 22:53
mveOriginalGriff15-Jun-16 22:53 
QuestionAccess Gmail contacts through C # Pin
Member 1253942914-Jun-16 14:42
Member 1253942914-Jun-16 14:42 
AnswerRe: Access Gmail contacts through C # Pin
BillWoodruff14-Jun-16 16:16
professionalBillWoodruff14-Jun-16 16:16 
AnswerRe: Access Gmail contacts through C # Pin
K Ashok 14-Jun-16 20:01
professionalK Ashok 14-Jun-16 20:01 
AnswerRe: Access Gmail contacts through C # Pin
Pete O'Hanlon14-Jun-16 21:04
mvePete O'Hanlon14-Jun-16 21:04 
GeneralRe: Access Gmail contacts through C # Pin
Member 1253942924-Jun-16 1:52
Member 1253942924-Jun-16 1:52 
NewsIcon c# library Pin
Matthew Hazlett14-Jun-16 10:37
Matthew Hazlett14-Jun-16 10:37 
GeneralWrong forum Pin
Richard Deeming14-Jun-16 11:18
mveRichard Deeming14-Jun-16 11:18 
GeneralRe: Icon c# library Pin
BillWoodruff14-Jun-16 16:06
professionalBillWoodruff14-Jun-16 16:06 
Questionhow to create three moving cars from different directions meeting at the junction Pin
Member 1252666814-Jun-16 5:22
Member 1252666814-Jun-16 5:22 
AnswerRe: how to create three moving cars from different directions meeting at the junction Pin
Simon_Whale14-Jun-16 5:30
Simon_Whale14-Jun-16 5:30 
AnswerRe: how to create three moving cars from different directions meeting at the junction PinPopular
OriginalGriff14-Jun-16 6:19
mveOriginalGriff14-Jun-16 6:19 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
Kenneth Haugland14-Jun-16 6:52
mvaKenneth Haugland14-Jun-16 6:52 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
OriginalGriff14-Jun-16 8:14
mveOriginalGriff14-Jun-16 8:14 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
Kenneth Haugland14-Jun-16 8:30
mvaKenneth Haugland14-Jun-16 8:30 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
OriginalGriff14-Jun-16 8:47
mveOriginalGriff14-Jun-16 8:47 

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.