newbie,update splitcontaner back color and save new color
I have 2 forms.
form1 is the main form and options form is the second form.
i have a splitcontainer on form1 with a menu strip that opens options form.
i have a usercontrol on each of the splitcontainer panels.
i have a button on the options form to open a colordialog.
what i would like to do is ,after pressing the ok button on the color dialog,the back color of usercontrol1 of the splitcontainer on form1 would update and save.
after i close and reopen the aplication the last color that i picked would be active.
please see code below it's not working.
it gets as far as opening the color dialog.
after i press ok once it does nothing if i press it again it errors out.
Thanks
public
Class optionsformPrivate MyControlbaAs UserControl1Private MyControlbdAs UserControl2PrivateSub Button1_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles Button1.ClickSelectTextColor()
EndSubPrivateSub SelectTextColor()Dim ColorDialog1AsNew ColorDialog()ColorDialog1.ShowDialog()
If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OKThenMyControlbd.BackColor = ColorDialog1.Color
EndIfEndSubEnd
Class
[2782 byte] By [
rod_r] at [2007-12-24]
ok i created a usersetting named ControlBackColor.
everything looks ok but when i start the debug,i get the following error "argument exemption was unhandled.
here is the code for form1
thanks
Public
Class Form1
Private MyControlba As baUserControl
Private MyControlbd As bdUserControl
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MyControlba = New baUserControl
MyControlbd = New bdUserControl
MyControlba.Parent = SplitContainer1.Panel2
MyControlbd.Parent = SplitContainer1.Panel2
MyControlba.Dock = DockStyle.Fill
MyControlbd.Dock = DockStyle.Fill
MyControlba.Visible = False
MyControlbd.Visible =
FalseEnd SubPrivate Sub btnba_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnba.ClickMyControlba.Visible =
TrueMyControlbd.Visible =
FalseEnd SubPrivate Sub btnbd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbd.ClickMyControlba.Visible =
FalseMyControlbd.Visible =
TrueEnd SubPrivate Sub OptionsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptionsToolStripMenuItem.Clickoptionsform.Show()
End SubEnd
Class