Pedalen
03-31-2004, 08:42 AM
I'm working on a calendar program at the moment, and trying to gather different ideas of how to display the dates. I know it can be done using a DataGrid, but in that case I can hardly format the text or the layout. My next thought was using a HTML-page within the program. In that case I could easy modify the look to exactly as I want it, but there is a small catch.. say I display a whole year within the HTML-page; then it would really be nice at the start up, to scroll down to today's date - something I'm not too sure of how to achieve. Anyone have any suggestions or other tips?
Regards,
Pedalen
AtmaWeapon
03-31-2004, 09:01 AM
It sounds to me that you need a custom control. No existing control in .NET really fits for a calendar, and tweaking an existing control would be difficult enough that it may be better to start from scratch.
Of course, if you heavily tweak an inherited DataGridTextBoxColumn, you could probably get a DataGrid to work pretty well.
Either way you need a good bit of custom drawing.
Pedalen
03-31-2004, 11:26 AM
It sounds to me that you need a custom control. No existing control in .NET really fits for a calendar, and tweaking an existing control would be difficult enough that it may be better to start from scratch.
I see, that might be the best way. But I have never before made a control from scratch.. you don't happen to know any good introducting tutorial?
Regards,
Pedalen
AtmaWeapon
03-31-2004, 11:48 AM
I'm just starting as well, so I can't be too much help.
Unfortunately, there aren't too many good resources I have found on .NET controls. This MSDN article (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconcontrolcreationbasics.asp) is a good starting point, but to me the examples in MSDN aren't really meaty enough.
This book (http://www.microsoft.com/MSPress/books/6451.asp) is pretty good. I'm about halfway through it and it has been helpful so far. There are a few books for C# controls development on Amazon. I haven't purchased any of them so I can't tell if they are any good or not. If you know a little bit of C, C# isn't very tough to convert to VB.
All in all, I find control authoring to be a kind of Zen thing; you have to understand the whole before the parts make sense. Unfortunately, coverage at MSDN seems to assume you know a lot, and little things here and there are not documented.
You may want to look around and see if someone has done something similar. I'm not really sure how much you could customize it, though, it doesn't seem like many people do open source VB code for some reason. The HTML solution may turn out to be the easiest.
Machaira
03-31-2004, 11:50 AM
What exactly do you want this app to do? Have you looked at the MonthCalendar control?