• Minimize to tray?
    26 replies, posted
How can i minimize my program to the tray when you click the default minimize button? Visual C#.NET
In the FormClosing event, hide the form and cancel the closing event. This is assuming you already have a NotifyIcon component on your form.
When you say notify icon?
[url]http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.aspx[/url] It's a form component that you can drag from the toolbox in Visual Studio.
How can i cancel the form closing event? I got everything else. Edit: It's return isnt it? -.-
[QUOTE=Encryption;20984174]How can i cancel the form closing event? I got everything else. Edit: It's return isnt it? -.-[/QUOTE] Set Cancel to true in the EventArgs that are sent to the event.
[QUOTE=Ortzinator;20984210]Set Cancel to true in the EventArgs that are sent to the event.[/QUOTE] I feel like an idiot because i don't know how to do that.
go read a book
[QUOTE=efeX;20984306]go read a book[/QUOTE] Or you could tell him to do [cpp] e.Cancel = true; [/cpp] In the event. I always wonder why helping people is difficult in this forum...
[QUOTE=VoiDeD;20984324]Or you could tell him to do [cpp] e.Cancel = true; [/cpp] In the event. I always wonder why helping people is difficult in this forum...[/QUOTE] Now i'm considered one that always requires a "chad".
-snip-
Lets not start this again.
[QUOTE=Encryption;20984365]Now i'm considered one that always requires a "chad".[/QUOTE] Well, the circumstances are the same: you were told how to do it, but were unable to without a snippet you could just copy into your program.
[QUOTE=TheBoff;20989524]Well, the circumstances are the same: you were told how to do it, but were unable to without a snippet you could just copy into your program.[/QUOTE] Learning by example. When you were taught how to find the area of a circle, I'm sure your teacher gave you some examples. When you were taught how to add numbers I'm sure your teacher gave you some examples. When you were learning to code I'm sure what you read gave you examples, or the people who helped you provided some.
[QUOTE=Xera;20990251]Learning by example. When you were taught how to find the area of a circle, I'm sure your teacher gave you some examples. When you were taught how to add numbers I'm sure your teacher gave you some examples. When you were learning to code I'm sure what you read gave you examples, or the people who helped you provided some.[/QUOTE] This. I agree so much with this that it's impossible to express how much I agree with it.
[QUOTE=Xera;20990251]Learning by example. When you were taught how to find the area of a circle, I'm sure your teacher gave you some examples. When you were taught how to add numbers I'm sure your teacher gave you some examples. When you were learning to code I'm sure what you read gave you examples, or the people who helped you provided some.[/QUOTE] I also agree with this. Which is why I disapprove of everyone bullying Chad!
[QUOTE=TheBoff;20991145]I also agree with this. Which is why I disapprove of everyone bullying Chad![/QUOTE] I agree, except for the Chad part, he's just a idiot.
Some people have different ways of learning, the best way to learn the ins and outs of something is to use as many available inputs as possible with the most detailed normally being books. As the authors of these books get paid large sums normally depending on how great the books is to you the reader/buyer. Encryption, I would recommend carving some time out of your day to read a book that is on the subject you are trying to learn. When you get to something in that book that you are stuck at or need more help comprehending what the author is describing to you, come here and we facepunch programmers will help you out.
[QUOTE=Xera;20990251]Learning by example. When you were taught how to find the area of a circle, I'm sure your teacher gave you some examples. When you were taught how to add numbers I'm sure your teacher gave you some examples. When you were learning to code I'm sure what you read gave you examples, or the people who helped you provided some.[/QUOTE] This is what I tried to explain but everyone just bitched and bitched. I can't learn if you just say "do this" because your not explaining [B]what[/B] to do. You're just saying to do it. Instead of saying "use this function" say "this function could be useful, heres how to use it :words:" Jesus Christ. [editline]10:50PM[/editline] [QUOTE=quincy18;20994848]I agree, except for the Chad part, he's just a idiot.[/QUOTE] Why am I an idiot? Because it's a little harder for me to learn? :ramsay:
[QUOTE=Chad Mobile;21000341]This is what I tried to explain but everyone just bitched and bitched. I can't learn if you just say "do this" because your not explaining [B]what[/B] to do. You're just saying to do it. Instead of saying "use this function" say "this function could be useful, heres how to use it :words:" Jesus Christ.[/QUOTE] fucking christ. we told you exactly what to do whenever you asked for help and you still bitched when we didn't give you VB that was directly copypastable.
Quit arguing because you know your wrong. You didn't help me, you gave me a short phrase that I didn't understand or something else that I didn't understand. Not everyone is a perfect programmer, and you need to take this into mind. Not everyone knows what you know, so don't expect everyone to be as good as you. Just because you know more doesn't make you better. You didn't bother to EXPLAIN anything either, you just threw it at me.
[QUOTE=Chad Mobile;21002648]Quit arguing because you know your wrong. You didn't help me, you gave me a short phrase that I didn't understand or something else that I didn't understand. Not everyone is a perfect programmer, and you need to take this into mind. Not everyone knows what you know, so don't expect everyone to be as good as you. Just because you know more doesn't make you better. You didn't bother to EXPLAIN anything either, you just threw it at me.[/QUOTE] OK, It's Visual fucking Basic. It is extremely easy to convert when somebody says use this function, into a usable snippet (In most cases). And don't even try saying that I am a hypocrite because somebody chose to give me a snippet that did exactly what I needed to be done. Use some common sense dude. Especially your question on how to make sure a picture box does'nt go off a form if you have buttons that just add and subtract the height and left from the picturebox. It's common sense that you just throw a few If Thens into the equation to prevent that from happening -.-
That is a perfect example of what I meant. You aren't explaining anything. [quote=Encryption]It's common sense that you just throw a few If Thens into the equation to prevent that from happening[/quote] How does that explain anything? Throwing If Thens into the [B]equation[/B] is perfectly feasible!!
[QUOTE=Chad Mobile;21003666]That is a perfect example of what I meant. You aren't explaining anything. How does that explain anything? Throwing If Thens into the [B]equation[/B] is perfectly feasible!![/QUOTE] OMFG Read the whole statement. "Equation" would = your problem
Ok, throwing If Thens into my [B]problem[/B] is perfectly feasible, I'm sorry.
Preventing the box from going offscreen has nothing to do with programing. It's pure logic and that, my friend, can't really be taught. I saw a thread where a guy was helping you and your posts were just comming with new questions, almost like you didn't even try do do it yourself. I can understand perfectly if you don't know how to do a specific thing in a specific language but if you ask something that you most surely can think of yourself and someone says something like "It's common sense that you just throw a few If Thens into the equation to prevent that from happening" he's trying to tell you to think. The solution is apparently very obvious if you take a bit of your own time and not someone else's. I don't know if you solvedr that exact problem by try to think. You have the X coordinate of the left and right sides of the windows, you have the y coordinate of the top and bottom sides. You have the X and Y of the top right corner (I think) of the box that mustn't go off screen. Left and top bounds are really obvious. If the box's X if less than 0, set X to 0 to keep it on screen. Same for Y. Now, why do you think that wouldn't work for the right and bottom bounds?
[QUOTE=Chad Mobile;21002648]You didn't help me, you gave me a short phrase that I didn't understand or something else that I didn't understand.[/QUOTE] I didn't give you a short phrase. I gave you C# code that reads a file into a string array and pulls a username out of the first line and a password out of the second line. And since VB and C# share the SAME framework, it's fucking trivial to translate to VB
Sorry, you need to Log In to post a reply to this thread.