MonthView Object 
Author Message
 MonthView Object

I have a MonthView object that I use to pick a date. Then
I click on a Command button to process the date.
But the first time I click on the button, nothing happen, not
even a line of code is executed, the second time, everything
is OK.

Anyone ever saw this? any suggestion?

thanx

Patrick



Sat, 17 Nov 2001 03:00:00 GMT  
 MonthView Object
What event are you using for the command button?  If it is the "Click" event,
try the "mousedown" event.  That is just a guess,
cause I don't know monthview all that well.

There is more faith in honest doubt than in all creeds combined.

http://www.angelfire.com/az/desertavatar
VBStrings, a VB string function tutor on website!
Interlinear Latin, History, Great Pyramid, Spansh Castle.



Sun, 18 Nov 2001 03:00:00 GMT  
 MonthView Object
I believe there is a bug in the MonthView control. To see it in action place
a command button and a MonthView control (Microsoft Common Controls-2 6.0)
on a form. Add the following code:

Private Sub Command1_Click()
  Beep
End Sub

Run the program and click on the command button, you should hear a beep
(provided the command button has focus). Now click on the MonthView control
and then click on the command button. This time you won't hear a beep, so
click the command button again. It appears that once the MonthView control
has focus, the other controls on the form will not fire their click event
until focus is shifted from the MonthView control.

One work around I have discovered is to add the following code:

Private Sub MonthView1_Validate(Cancel As Boolean)
  Command1.SetFocus
End Sub

Now it will work ok. It doesn't matter which control you shift focus to as
long as the control you shift focus to has its CausesValidation property set
to true.

One possible problem with this method, is that any control on your form that
has it's CausesValidation set to false will still need two clicks in order
to make it function.

--
Regards
Stanley Peck


Quote:
> I have a MonthView object that I use to pick a date. Then
> I click on a Command button to process the date.
> But the first time I click on the button, nothing happen, not
> even a line of code is executed, the second time, everything
> is OK.

> Anyone ever saw this? any suggestion?

> thanx

> Patrick



Sun, 18 Nov 2001 03:00:00 GMT  
 MonthView Object
Thanks a lot, it worked perfectly...

Patrick



Sun, 18 Nov 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. SQL and MonthView object

2. "MonthView" object in Visual basic

3. Using MonthView?

4. monthview : help

5. MonthView

6. MonthView Control in VB6

7. DatePicker/MonthView in localized version of Windows

8. Calendar (MonthView Control - Starting Date)

9. Monthview - select week?

10. MonthView ActiveX problem

11. MonthView Control

12. MonthView Calender

 

 
Powered by phpBB® Forum Software