DateTimePicker BackColor DesignMode

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • llorracj
    New Member
    • Jan 2008
    • 6

    DateTimePicker BackColor DesignMode

    I have used the code I found on your site by Herr Wagner. It works perfectly except for one minor problem. The color does not change in design mode, only run mode.

    Any suggestions
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    #2
    Originally posted by llorracj
    The color does not change in design mode, only run mode.
    Which version of vb do you use?....
    im not sure about vb6 but in later editions .....you can view the designcode..... .(This is the code the program uses to display and design your form.)
    (not event code)..
    I believe the code you placed was in the event area

    you need to enter the code in the design area.

    Comment

    • llorracj
      New Member
      • Jan 2008
      • 6

      #3
      I'm using VB.Net 2005. I'm not sure what you mean by the "design area" and "event area".

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        I'm only VB6, but it seems unlikely that anything in your code would affect what the control looks like at design time.

        Comment

        • llorracj
          New Member
          • Jan 2008
          • 6

          #5
          .Net allows you to inherit from the Microsoft supplied controls. You can then add properties and methods to enhance the control. Unfortunately, in their infiinte wisdom, Microsoft decided to make the BackColor and ForeColor properties of the DateTimePicker control visible, but did not implement the properties. They also did not provided a user accessible Pain event. Setting the BackColor and ForeColor properties has no effect. If you want to change the BackColor of the DateTimePicker you need to implement your own BackColor property and and override the WndProc subroutine to have the property take effect (see http://dotnet.mvps.org/dotnet/faqs/?...color&lang=en). The code provided at the previously mentioned web site works fine and changes the color run mode but does not change the color in design mode, hence my original question.
          Last edited by Killer42; Jan 8 '08, 01:56 AM. Reason: Activate link

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Oops! :)

            Comment

            Working...