Ok i Got the Form1 and the Dialog3

i can save the trackbar1.value but when i save and close and open the application in the dialog3 says the value of the trackbar1 but the form1 opacity dont save :S

----- Button1 to save -----


My.Settings.TaxiTransparency = TrackBar1.Value


TrackBar1.Value = My.Settings.TaxiTransparency
Label5.Text = My.Settings.TaxiTransparency


Form1.Opacity = TrackBar1.Value / TrackBar1.Maximum
AboutBox1.Opacity = TrackBar1.Value / TrackBar1.Maximum
Dialog1.Opacity = TrackBar1.Value / TrackBar1.Maximum
Dialog2.Opacity = TrackBar1.Value / TrackBar1.Maximum
Label5.Text = TrackBar1.Value
TrackBar1.Value = Label5.Text

So can anyone help me how to make it save that when i open again the app is already in the opacity

in Form1 i just put
Me.Opacity = Dialog3.TrackBar1.Value

but didnt work :(

7 Years
Discussion Span
Last Post by xfrolox

Remember that Opacity is a percentage; so a trackbar value of 50 isnt going to help in the form.opacity value. You need to convert it to 0.50.

Me.Opacity = Dialog2.TrackBar1.Value / 100

i put
Me.Opacity = Dialog3.TrackBar1.Value / 100
in the Form1 and still nothing :S besides 100 is 2 high i have to maximum / 10


If 10 is your max value, then you have to figure out what calculation would equate 10 being 100%, 5 being 50% etc.

For instance
TrackBar1.Maximum = 100
TrackBar1.Minimum = 0
TrackBar1.Value = 50

Me.Opacity = TrackBar1.Value / 100 'Result Opacity = 0.5


Using 10 as your max, you can multiple by 0.1. For example a trackbar value of 5 * 0.1 would give you a percentage of 0.5


u dont get me lol i think ^^
when i move the trackback1 it does make the transparency but when i click
button1 that saves and i close the app and re open the Form1 appear without transparency, then i open dialog3 it says is in 5 but in form1 does not, if i move the slide again it will change the form1

im trying to save the opacity so when i re open application it will open
with the opacity i save.


I get it just fine.... 5 is not going to change the opacity level of your form, you need to convert it so that the opacity is 0.5


if i put
Me.Opacity = Dialog3.TrackBar1.Value / 100

it will always appear 2 transparent i want it to appear with the
Dialog3.TrackBar1.Value that i save
my save setting is
so when i save the dialog3 does really save but the form1 dosnt save the opacity :S


c'mon now..... there is no division by 100 if you have 10 as a max value. Instead you multplie by one tenth.

Me.Opacity = My.Settings.TaxiTransparency * 0.1

Thx you got a reputation for helping me

Thx bro the thingy i didnt know if i put it as multiplication will work, thx :):):):)

I give u 1 reputation and a vote in post :)
Thread Solved


TomW i mark it as Unsolved cuz now i get an error.
Ok i Debug is everything perfect but when i open it Normally no with VB it get an error that says continue or quit, when i took the * 0.1 the problem goes away but the opacity dont save :(


I showed you how to take your trackbar value that you were saving; calculate it and use the new value to assign to your opacity property. I have no clue how you are attempting to save/load a seperate setting since that wasnt discussed.


the thing is cuz is in different Form
Form1 should have the opacity value of the
Form2.Trackbar1.Value or of the save setting that i have to save the value
that is My.Settings.TaxiTransparency but if i put * 0.1 it give an error




That error msg states you are converting a blank string into a double... Apparently whatever your doing is text and has no value at all.


Yeah, its something with this line
Me.Opacity = My.Settings.TaxiTransparency * 0.1

im still trying to figure it out

Edited by xfrolox: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.