Calendar

  • Thread starter Thread starter Dino M. Buljubasic
  • Start date Start date
Hi Dino,

Welcome back. :-)

Yes, that extra few pixels is a real pain isn't it! I've only just read
your post so I'll come back to you on this one. The solution involves
capturing the Resize and only allowing a resize when the difference suits the
Calendar - not the user. The additional difficulty here is that it's the Form
that resizes and the Docking manager passes this onto the Calendar Control.
But it's the Calendar Control that cares about the amount - not the Form -
unless we make it the Form's business. I'll need a little think here. ;-)

Your code wasn't attached. Any chance of it? I'll be working this out on
my version, but I'd like to keep abreast of your developments.

Regards,
Fergus
 
Hi Fergus,

the panel looks cool, I have added whole bunch to it. It is really cool.
The code you have sent to me was really helpful. I really appreciate it.

I have one question, it should not be difficult, but I just don't get it.
I'd like to get the value of the cell label (day number) I right-clicked on.
I can get it with my click event, but I need to get it when I click right
mouse button. I tryied converting sender to label and then reading it but
because my sender is context menu, not the label in this case, I get an
error "Invalid Cast".

I need it for my context menu that is activated on right click. Can you
help me with that?



Thank you
dino
 
Fergus, I got this one.
I just accessed myContextMenu.SourceControl property, which is Label. Works
fine.
Thanks ,
dino :)
 
Hi Dino,

If you trap MouseDown rather than Click, the menu won't have appeared yet
and sender will be the Label.

Any chance of seeing the Calendar? If you don't want to post it here, you
could post a zip to me at (e-mail address removed) (the address shown here in the group
is real but it isn't working unfortunately).

Regards,
Fergus

ps. I've had a headache today and haven't looked at the pixels problem yet.
:-(
 
Hi Dino,

Like I said before, your app is getting to look real smart. I've had a
look under the hood and it's getting tasty in there too!! :-))

The variable pixel border on resizing is now dealt with but you'll have to
set a correct minimum size for the form. I've also made the cell borders just
a pixel wide by overlapping the edges.

I've done a lot of work in making it faster and cleaner when you move
forward and backwards between the months.

In the course of doing that I moved a lot of the graphical stuff into the
CalendarCell where it belongs. You're new to UCs and I was only able to
vaguely explain it in the earlier posts, but the UC should do as much for
itself as possible, and the user of the UC (ie. the Form) should have
properties and methods that ask it to do these things.

The idea about a UC is that as far as possible, it doesn't let the user
play with its innards. So rather than letting the Form have access to the
label and textbox so that it can set colours and do painting, etc, the form
tells the Cell to enable or disable, to show the day highlighted, etc. The
cell works out how to actually do that. In other words the Form thinks in
terms of calendar type things, like "this cell is today's so let's highlight
it" and the Cell thinks "I'm highlighted so my label's font and colours ...
etc".

The Cell is now responsible for showing itself when selected. This works
with the Tab key as well as the mouse. There is a wierd thing when tabbin left
from Day 1. It takes 7 left tabs to get to the buttons and I suspect that the
CellHeaders are getting the focus - despite them having TabStop set to False.
I didn't have time, though.

I see a need for classForms and modForms to be merged but again didn't
have time to get involved in that.

I look forward to seeing the next stage. ;-)

Regards,
Fergus
 
Hi Fergus,

can you send me the code please, I'd like to take a look at it. You are
mentioning lots of things that I was thinking about and how to change them
(e.g. cell border, time of refreshment when moving from month to month, etc)

Thank you for your help
Dino
 
Hi Fergus,

I just realized that from some reason, I am not getting any emails in my
email box. Untill we fix that problem here at the office, you can use my
address:
(e-mail address removed)

That is my home address. Can you send me the calendar code please on the
address above.

Thank you for huge help :)
Dino
 
Back
Top