Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
As part of a program, there are situations in which the user has to be quickly notified that something is going on.
I was thinking of using Notify Icons. For some reason, they appear but don't dissapear automatically as I expected. (As in toasts in other platforms)
Then I found the status strip. Which seems convenient too and simpler to program although I have to manually remove the message
or should I go for the old MessageBox as I have been doing so far.
what are the pros or cons on using those methods of communication with the user?
Depending on your usecase and the importance of your message to the user you'll have to consider the following points:
Is the message important enough to stop the users current workflow immediately, like a messagebox does?
Is it okay, if the users misses a message, because it disappears automatically after a certain amount of time?
A messagebox is clearly the most intruding way of communicating with the user. The status strip on the other hand can easily be missed. Notification Icons including a balloon tooltip are somewhere inbetween. The ballon will most certainly close after a few seconds. But you could also add a timer to remove the notification icon itself after a certain amount of time, too.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
On clicking directly my c# application.exe file, i am running my application and its process in task manager appears if that process on certain condition kills my application stops. What i want is to re run the application after delay of 5 seconds by it self.
You cannot. That process is gone. What you can do is start a second process with you first, most commonly called a "watchdog" or "guard", to scan for your first process and if it does not find it, start it. It's not foolproof though, somebody could just as easily kill that process, too. It's just another layer.
Advice on how to implement that is far to broad for this format, I suggest you read some good articles on it, try to implement it and come here when you find yourself stuck at a specific problem.
Although my answer might not be that helpful, and also this question isn't a kind related to coding issues, but I suppose, using Windows Task Scheduler might work out for you, as you can add various triggers to your application and repeat your task after any set amount of time.
Hope it helps. Thanks
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm looking for a way to deal with threads (I guess using semaphors) to stop all threads from entering a certain region for a while. When all threads that are currently in the region get out of it (so no thread is in it anymore), I want to do something that affects this region. After that, the region should be enterable by many threads at the same time again.
I don't see how to do it with the Semaphore since in the documentation I can't find any properties which f.e. Let me change its property on how many can enter the region and even get the amount how many are inside at all.
How could I do this?
Sounds bit like you looking for ReaderWriterLockSlim class. Many thread can enter/get read lock, but only one thread can get write lock.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have a windows form which have a textbox & a button on it.
I'll show & use this form for filtering some datagrid columns when right clicked their column header.
And this form will be using constantly obviously.
Now I'm thinking,
Should I close it everytime or simply hide & reshow when needed?
Which is the best for performance & memory? Or do you suggest any other thing for this filtering type?
Which is the best for performance & memory?
"Best" isn't a question nor a SMART requirement.
Of course if you just hide the form, it and its contents will stay in memory. This means your application uses more memory, but on the other hand, when you need to show the form again, you won't have to load the entries from the database again - making it appear faster.
If it's a form you really frequently need, I'd just hide and re-show it. See Hide form instead of closing when close button clicked how to do this.
If the app runs very fast, it may be better to close it. If loading is heavy - hide it.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Can you please point me into the right direction?
I want to edit other application textbox or click, programmatically. For example, in a web sites, I can edit elements and invoke button clicks.
I have no idea how to do this, but I can move mouse and use keyboard run time is it possible to edit other application's textbox ?
I have C++, VB.NET, and C# knowledge - any suggestions or sample code?
Thanks.
There is no easy way to do this, but it is possible. You will dig through the Win32 Api to get what you need. There will be a lot code needed for this, too much to put in sample here.
You will need to start with finding the window you want. This could be accomplished with FindWindowEx. When you have the window, you can enumerate the child controls using EnumChildWindows.
When you finally get the handle to the control you need, you can hook up to the windows message subsystem and send a WM_SETTEXT message using the SendMessage function. There is a wrapper function available: SetWindowText but the documentation clearly states that it will NOT work for windows of other applications.
Be prepared for a lot of digging around in the Win Api. You will probably run into issues regarding security in newer windows OS's. When you get it to run the functionality will be highly depending on the OS, UAC settings etc.
I remember doing this once, 15 years ago in Windows 98, even then it was problematic! So good luck!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hope everyone is well.
I am dealing with a multiplayer system and having a problem with the real time refresh. I've tried, metatags, JS function:set intervals for a div, Ajax refresh based on success,.... They all work on that particular screen.
So example if Jack, Barney, Nick and Mary are online playing this game.... When Mary plays, her screen will refresh/update divs accordingly.... However on the other 3 player's screens nothing will happen.
I need a REFRESH/UPDATE of a div to take place when a click is made by any user, this refresh/update must happen ON MULTIPLE SCREENS (any user who is on that page must be able to view the most recent and up to date set of data)
If you have any information on how to go about doing this, please let me know! :)
In other words, you need the server to notify clients of events. With ASP.NET, you should use SignalR for that. It uses the modern WebSockets API if available, and gracefully falls back to other techniques like polling in browsers that don't support WebSockets.
You can find a good example of SignalR 2 using with MVC 5 here:
http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-getting-started-with-signalr-20-and-mvc-5