Help needed for c# picturebox as 'Button'

  • Thread starter Thread starter V0LT!GE
  • Start date Start date
  • Views Views 4,286
  • Replies Replies 25

V0LT!GE

Well-Known Member
Newcomer
Joined
Feb 13, 2016
Messages
99
Reaction score
27
Trophies
0
Age
28
XP
201
Country
Gambia, The
Hey guys!
Need help with c# in visual Studio really quickly..
so my Problem is that i want a picturebox, when i hover with my mouse over it that it changes its Image
but i dont know how to do that ;D
could you guys help me ?
 
if you want a GUI or the ability to display images you need to learn a gui library like GTK or Qt
stay the fuck away from .net

edit: actually I might be wrong
dunno how C# works
 
Last edited by Nyap,
Select the picture box. On the properties panel (usually in the bottom right), you'll see an icon that looks similar to a thunder bolt (events). On the list of events, I believe you want to double click the OnMouseHover event. It'll create the event for you, and you can (via code) change what image the picture box shows.

--------------------- MERGED ---------------------------

if you want a GUI or the ability to display images you need to learn a gui library like GTK or Qt
stay the fuck away from .net

edit: actually I might be wrong
dunno how C# works
Nothing is wrong with .NET especially with the introduction of mono
 
i now what These Events are and where to find them xD dont feel attacked :D
but i dont know how to Code that piece of Code that changes the Image file :(

Edit: and what could i use to create some UIs for visual Basic or to create some Buttons?
 
Last edited by V0LT!GE,
What Kliffcom said.
if you want a GUI or the ability to display images you need to learn a gui library like GTK or Qt
stay the fuck away from .net
Except using .Net, it's is way easier to make UIs.

Although I would recommend WPF over Windows Forms for these reasons:
- UI scaling works better
- Animations are easier
- You can easily use MVVM to reduce the amount of coupled code you have to write

The disadvantages:
- No open/save file dialogs (I usually reference Windows Forms for this)
- You either have to use different classes for images, or have to convert
- Mono doesn't support it (but IMO this doesn't matter too much since the majority of people use Windows anyway, and the benefits outweigh this disadvantage)
 
What Kliffcom said.

Except using .Net, it's is way easier to make UIs.

Although I would recommend WPF over Windows Forms for these reasons:
- UI scaling works better
- Animations are easier
- You can easily use MVVM to reduce the amount of coupled code you have to write

The disadvantages:
- No open/save file dialogs (I usually reference Windows Forms for this)
- You either have to use different classes for images, or have to convert
- Mono doesn't support it (but IMO this doesn't matter too much since the majority of people use Windows anyway, and the benefits outweigh this disadvantage)

so which piece of Software is it? is it hard to hanlde cuz im still a bit (3 month) new to c#
EDIT: or can i still use visual Studio for that picturebox im ok for suggestions :P
EDIT2: and can it be that i said smth wrong? i mean that i use visual studo and not Basic srry xD
 
Last edited by V0LT!GE,
so which piece of Software is it? is it hard to hanlde cuz im still a bit (3 month) new to c#
EDIT: or can i still use visual Studio for that picturebox im ok for suggestions :P
WPF is amazing and built into Visual a Studio but is a lot more difficult to conceptualize and properly use. I wouldn't recommend you jump into yet at the moment.
 
  • Like
Reactions: evandixon
OP, if you're in college you can get this for free. However, (and I may be wrong) you seem younger and may need to go the way of pirates, but I strongly encourage you to use resharper. It's an amazing plugin that will pay off in the long run if you learn how to properly use it.
 
OP, if you're in college you can get this for free. However, (and I may be wrong) you seem younger and may need to go the way of pirates, but I strongly encourage you to use resharper. It's an amazing plugin that will pay off in the long run if you learn how to properly use it.[/QUOTE
i start visiting college this year so thanks:) trying it out first tons of tutorials xD
--------------------- MERGED ---------------------------

It is the full project
oh oke :)
hope u did comments :P
 
Last edited by V0LT!GE,
No sorry. it is just one line since the event is not in the mainform. The picture used are in the resources
 
i start visiting college this year so thanks:) trying it out first tons of tutorials xD
--------------------- MERGED ---------------------------


oh oke :)
hope u did comments :P
No sorry. it is just one line since the event is not in the mainform. The picture used are in the resources
thank u and ive a question .. how can i reset the picturebox to the default 1. Picture? so when i leave the picturebox it has to be resetted to the first Picture and in this case GBATemp pícture?
 

Site & Scene News

Popular threads in this forum