For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > January 2006 > MonthView highlight









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MonthView highlight
Dan

2006-01-09, 7:16 pm

I have a MonthView control where I am setting the initial date via the Value
property. When the form is first displayed, it highlights and circles today's
date, regardless of the initial date that I defined. I have a Label control
on the form that displays the MonthView Value property, so I know that it is
not today's date. If I click on a different date (other than today), it
highlights that date. If I click a button that takes me to another form, when
I return the correct date is still highlighted. The only problem is when the
form is initially displayed before I've clicked on anything in the MonthView
control. How do I get it to highlight the correct date?

Dan
MikeD

2006-01-09, 7:16 pm


"Dan" <Dan@discussions.microsoft.com> wrote in message
news:1EC23E37-EF04-41C0-B60A-DE4B1112BE64@microsoft.com...
>I have a MonthView control where I am setting the initial date via the
>Value
> property. When the form is first displayed, it highlights and circles
> today's
> date, regardless of the initial date that I defined. I have a Label
> control
> on the form that displays the MonthView Value property, so I know that it
> is
> not today's date. If I click on a different date (other than today), it
> highlights that date. If I click a button that takes me to another form,
> when
> I return the correct date is still highlighted. The only problem is when
> the
> form is initially displayed before I've clicked on anything in the
> MonthView
> control. How do I get it to highlight the correct date?



Can you post code which reproduces the problem? Also, what service pack for
VB do you have installed (or what service pack version of the Windows Common
Controls 2 are you using)?

FWIW, I tried the following and it did not exhibit your described behavior
(IOW, the 31st was selected):

FORM1:
Private Sub Form_Click()

Load Form2
Form2.MonthView1.Value = DateSerial(2005, 12, 31)
Form2.Label1.Caption = Form2.MonthView1.Value
Form2.Show

End Sub

This was with the SP4 Windows Common Controls 2. Perhaps this was a bug
that got fixed; although I'd say it's more likely your code.

--
Mike
Microsoft MVP Visual Basic





Dan

2006-01-09, 7:16 pm

Mike,

I am using VB SP6. Your code worked fine on my system too.

You were absolutely correct: The problem was with my code. After looking at
it more closely, I discovered why it was behaving exactly as it should have
behaved but not as I wanted! It's now fixed. Thanks for your help!

Dan

"MikeD" wrote:

>
> "Dan" <Dan@discussions.microsoft.com> wrote in message
> news:1EC23E37-EF04-41C0-B60A-DE4B1112BE64@microsoft.com...
>
>
> Can you post code which reproduces the problem? Also, what service pack for
> VB do you have installed (or what service pack version of the Windows Common
> Controls 2 are you using)?
>
> FWIW, I tried the following and it did not exhibit your described behavior
> (IOW, the 31st was selected):
>
> FORM1:
> Private Sub Form_Click()
>
> Load Form2
> Form2.MonthView1.Value = DateSerial(2005, 12, 31)
> Form2.Label1.Caption = Form2.MonthView1.Value
> Form2.Show
>
> End Sub
>
> This was with the SP4 Windows Common Controls 2. Perhaps this was a bug
> that got fixed; although I'd say it's more likely your code.
>
> --
> Mike
> Microsoft MVP Visual Basic
>
>
>
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com