Pergunta

Okay I have a VB.Net project that I have to create on my own for school that has a list of requirements which are too long to list here, so I will get to the point. I am trying to make just a quick form where it will display my artwork depending on which radio button is clicked. I have it figured out if there is only 1 radio button, where it puts the image in the picturebox. However I would like it to display an image when 2 radios are checked. Makes the form look much cleaner and nicer.

So I have 2 groupboxes, first one has the radio buttons of the medium that my artwork is in, the second has radios of the name of the picture. I want it so that the person checks the color pencil radio, then checks the forest path radio my drawing of color pencil forest path in my resources pops up in the picture box, then if they click the charcoal radio the charcoal version of my forest path pops up.

Is it possible to do this?

Foi útil?

Solução

  1. Everything is possible.

I'm not going to give you the whole answer but what you want to look for are the On_Event handlers.

After you create a radio button, go to the properties and click the little "Lightning Bolt" and look for something like On_Check_Changed.

After that you just have to set all the conditions:

If rdioColorPencil.checked then 
     picturebox's picture = colorpencil.jpg
     picturebox.refresh()
End if

The On_Event handlers are some of the most useful things in .Net. They allow for everything from right clicks to form changes. Get acquainted to them.

Good Luck

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top