Help needed for c# picturebox as 'Button'

V0LT!GE

Well-Known Member
OP
Newcomer
Joined
Feb 13, 2016
Messages
99
Trophies
0
Age
25
XP
171
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 ?
 

Nyap

HTML Noob
Banned
Joined
Jan 13, 2016
Messages
971
Trophies
0
Age
55
Location
That Chaos Site
XP
493
Country
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,

fafaffy

Well-Known Member
Member
Joined
Sep 1, 2012
Messages
345
Trophies
0
XP
717
Country
United States
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
 

V0LT!GE

Well-Known Member
OP
Newcomer
Joined
Feb 13, 2016
Messages
99
Trophies
0
Age
25
XP
171
Country
Gambia, The
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,

evandixon

PMD Researcher
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
1
Website
projectpokemon.org
XP
2,401
Country
United States
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)
 

V0LT!GE

Well-Known Member
OP
Newcomer
Joined
Feb 13, 2016
Messages
99
Trophies
0
Age
25
XP
171
Country
Gambia, The
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,

fafaffy

Well-Known Member
Member
Joined
Sep 1, 2012
Messages
345
Trophies
0
XP
717
Country
United States
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

fafaffy

Well-Known Member
Member
Joined
Sep 1, 2012
Messages
345
Trophies
0
XP
717
Country
United States
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.
 

V0LT!GE

Well-Known Member
OP
Newcomer
Joined
Feb 13, 2016
Messages
99
Trophies
0
Age
25
XP
171
Country
Gambia, The
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,

Kliffcom

Well-Known Member
Member
Joined
Aug 26, 2014
Messages
144
Trophies
0
Age
26
XP
196
Country
Gambia, The
No sorry. it is just one line since the event is not in the mainform. The picture used are in the resources
 

V0LT!GE

Well-Known Member
OP
Newcomer
Joined
Feb 13, 2016
Messages
99
Trophies
0
Age
25
XP
171
Country
Gambia, The
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

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Extra soi