Showing and Hiding forums

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • The Midnighter
    New Member
    • Feb 2007
    • 15

    #1

    Showing and Hiding forums

    I did a search for this, and couldn't find anything so I thought I'd ask you guys.

    So, I've got two forms. I'm making a notepad for my class, and I'm trying to change the colour - The way I'm trying to do this is like this.
    I've got my main form, with my Richboxeditor and I've got a button I want the user to press to change the colour, it's going to open up my second form (frmColors) and here's how I've tried it so far, it's getting something to pop up, but it's not my form with my colours on it.

    Dim frmColor As New Form
    frmColor.Show()
  • TNT
    New Member
    • Feb 2007
    • 48

    #2
    I think that the "Dim frmColor As New Form" creates a new form over top of the one you created at design time. You could use a colour dialog, so you get a choice of any colour you want:

    Code:
    Private Sub btnChangeColor_Click
    ColorDialog1.ShowDialog
    frmMain.Color = ColorDialog1.Color
    End Sub
    Last edited by TNT; Feb 25 '07, 07:32 PM. Reason: Left something out

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      I'd suggest that you start by dropping the Dim statement and simply opening the form.

      But TNT's right, the common dialog control would be the better way to go - it includes the standard Windows colour picker. The specifics of how it is done may vary between versions of VB.

      Comment

      Working...