Tengo un pequeño problema
tengo un pequeño proyecto de en visual net studio
mi problema surge con el siguiente
tengo un formularios principal al cual le quiero cambiar la apariencia todo bien ya que se la logro cambiar pero cuando guardo los setting al cerrar no logro cargarlo desde en el primer formularios...
El codigo lo tengo de este modo
Citar
Codigo En el Formularios 1 no existe ningun problema Con este codigo ya que si me lo guarda y lo carga y todo bien
Citar
Public Class frmprincipal
Private Sub frmprincipal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
movgame.Movie = Application.StartupPath + "\" + "mariobros3.swf"
movgame.Play()
CbStyle.Items.Add("Default")
CbStyle.Items.Add("Azul")
CbStyle.Items.Add("Verde")
CbStyle.Items.Add("Rojo")
CbStyle.Items.Add("Amarillo")
CbStyle.SelectedIndex = 0
Me.Text = "Block de Nota |By Franco| ~~ " & Date.Today
CbStyle.Text = My.Settings.ColorStyle
'NUDopac.Value = My.Settings.FrmOpacidad
End Sub
Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NUDopac.ValueChanged
' Me.Text = "Block de Nota |By Franco| ~~ " & Date.Today & " ~~ " & Me.NUDopac.Value.ToString + "/100"
Me.Opacity = 0.2 + Me.NUDopac.Value / 100
End Sub
Private Sub CbStyle_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbStyle.SelectedIndexChanged
If CbStyle.Text = "Azul" Then
Me.BackColor = Color.Blue
ElseIf CbStyle.Text = "Verde" Then
Me.BackColor = Color.Green
ElseIf CbStyle.Text = "Rojo" Then
Me.BackColor = Color.Red
ElseIf CbStyle.Text = "Amarillo" Then
Me.BackColor = Color.Yellow
ElseIf CbStyle.Text = "Default" Then
Me.BackColor = Color.Chocolate
End If
End Sub
Private Sub cmdStyle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStyle.Click
If CbStyle.Text = "Default" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Azul" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Verde" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Rojo" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Amarillo" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
End If
End Sub
End Class
Private Sub frmprincipal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
movgame.Movie = Application.StartupPath + "\" + "mariobros3.swf"
movgame.Play()
CbStyle.Items.Add("Default")
CbStyle.Items.Add("Azul")
CbStyle.Items.Add("Verde")
CbStyle.Items.Add("Rojo")
CbStyle.Items.Add("Amarillo")
CbStyle.SelectedIndex = 0
Me.Text = "Block de Nota |By Franco| ~~ " & Date.Today
CbStyle.Text = My.Settings.ColorStyle
'NUDopac.Value = My.Settings.FrmOpacidad
End Sub
Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NUDopac.ValueChanged
' Me.Text = "Block de Nota |By Franco| ~~ " & Date.Today & " ~~ " & Me.NUDopac.Value.ToString + "/100"
Me.Opacity = 0.2 + Me.NUDopac.Value / 100
End Sub
Private Sub CbStyle_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbStyle.SelectedIndexChanged
If CbStyle.Text = "Azul" Then
Me.BackColor = Color.Blue
ElseIf CbStyle.Text = "Verde" Then
Me.BackColor = Color.Green
ElseIf CbStyle.Text = "Rojo" Then
Me.BackColor = Color.Red
ElseIf CbStyle.Text = "Amarillo" Then
Me.BackColor = Color.Yellow
ElseIf CbStyle.Text = "Default" Then
Me.BackColor = Color.Chocolate
End If
End Sub
Private Sub cmdStyle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStyle.Click
If CbStyle.Text = "Default" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Azul" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Verde" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Rojo" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
ElseIf CbStyle.Text = "Amarillo" Then
My.Settings.ColorStyle = CbStyle.Text
My.Settings.FrmOpacidad = NUDopac.Value
My.Settings.Save()
My.Settings.Reload()
End If
End Sub
End Class
Pero el problema es cuando quiero crear eso en un segundo formularios y llamarlo con un boton no logro cargar el cbstyle = que es un combobox del segundo formularios
Pd: si el post no va en este formularios algun @mod me puede hacer el favor de movierlo gracias