How Do I Save a Resource string into my.settings?

If the user picked from a resource image\sound...

Page 1 of 1

1 Replies - 7614 Views - Last Post: 17 October 2008 - 05:05 AM Rate Topic: -----

#1 EvolutionMedia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

How Do I Save a Resource string into my.settings?

Post icon  Posted 08 October 2008 - 02:34 PM

Okay, did some testing here and there. I put a message box and it says anytime I clicked on a radiobutton that has a resource file it reports back that it's a System.Drawing and that's why when the program goes to save the settings it doesn't do what I want.

I may have to put a string or something then when the form loads catch to see if there was a string that matches what I wanted to be like the resource file. So for example,


dim ResourceImageSelected as string

' When form is closed or whatever.

if radiobutton1.checked then 
ResourceImageSelected = "Demon"
my.settings.PrankImage = ResourceImageSelected

end if

' then when the form loads.

if my.settings.prankimage = "Demon" then
radiobutton1.checked = true
end if




Something like that? Or is there any way I can take the resource file string and save it into my settings? The other version I wrote is long but doable. Any sugguestions? Thanks!

OH, so far when the program saves it I have it like this:


	Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
		PictureBox2.Image = My.Resources.prnk.demon1
		browseimgs.Enabled = False

		imageselected = PictureBox2.Image.ToString

	End Sub




The browseimgs.enabled toggles whehter to enable the browse image for customizing the picture. So until it reaches the Custom radio then it changes to True.

Any help? Thanks!

-Paul

Is This A Good Question/Topic? 0
  • +

Replies To: How Do I Save a Resource string into my.settings?

#2 rollout369  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 17-October 08

Re: How Do I Save a Resource string into my.settings?

Posted 17 October 2008 - 05:05 AM

When the form is closed, you have to save the settings:

My.Settings.Save()
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1