Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar Control 10.0 in vb 6.0

Status
Not open for further replies.

greg85374

Programmer
Apr 27, 2003
10
US
I recently have been trying to use built in calendar controls to takie input from the user and store it on the calendar during run time. Unfortunately I can't or dont know how to reference any of the properties for the calendar control 10.0 I tried to place textboxes in all the date boxes but there was a problem...the calendar diplays more days than whats in the current month so how do i set the text boxes to invisible for the greyed out days in that month if i cant reference anything in the calendar....any possible solutions for adding text inside of calendar control would be extremely appreciated...thank you ahead of time for any suggestions.
 
Greg, Once attempted same thing.

I'm sorry to the seasoned members of this fantastic forum if this seems slightly defeat-ist. But i ventured for the easier option of placing a calendar control on your form (or a new form) and using a textbox and labels underneath (or alongside) the calendar control to contain data about the specific dates.



You will need an I/O File to store information about the specific dates, and it is probably helpful if you use another label/disabled textbox to show what dates there is information stored under.

[tt]

------------------------------
| |
| Cal. Control |
| |
| |
------------------------------
__________________
[_____TXTDATA______] [UPDATE]
__________________
[_____LBLDATES_____] [ EXIT ]

[/tt]

(Sorry For The Crudeness!)

N.B. If you are an extreme newbie to I/O, then look in MSDN Help for the OPEN Statement, it should have good examples.

Ex.
[tt]
OPEN "C:\DIARY\DIARY.TXT" FOR RANDOM AS #1

<<< DO YOUR BITS HERE >>>

CLOSE #1
[/tt]

The other option of course, is using a database, MS Access or otherwise.

It worked for me, but then I couldn't be bothered to find a way of directly referencing the control, assuming there is one.

If you want, i will send you a copy of the form that I came up with, it will probably require personalisations though.

Hope this helps,

¥oshi.



-------------------------
&quot;There is No Spoon..&quot;
-------------------------
 
Thanks YoshiCD....
I do believe there are at least two ways to more appropriately doing this...one to do it in access and have databinding keys(whatever you call it) and two to use CalendarUI add in component...I have it but its telling me i dont have a license for it..im using vb 6.0 working model edition. Unfortunately as im teching myself programming I realize theres a lot more t han I had thought to learn...like exactly what componenets do what..I realize Calkendarui is an activex ocx file of some sort but I dont know how to find out info about it or use it.
 
Hi Greg,

You could choose to use the Outlook Calendar instead of a text-file.
I've used it to create a calender-program which will show all the appointments in a special Category.


Example on writing a new &quot;once-a-year&quot;-recurring &quot;All-day event&quot;:

Sub Write_To_Outlook(BDate As Date, BName As String)
On Error Resume Next
Set myOlApp = CreateObject(&quot;Outlook.Application&quot;)
Set myAppt = myOlApp.CreateItem(olAppointmentItem)
Set myPattern = myAppt.GetRecurrencePattern
myAppt.Categories = &quot;VB-Created&quot; 'Sets the Category
myAppt.Subject = BName
myAppt.StartDate = BDate
myAppt.AllDayEvent = True
myPattern.RecurrenceType = olRecursYearly
myPattern.Interval = 1 'every one year
myPattern.StartDate = BDate
myPattern.DayOfMonth = Day(BDate)
myPattern.MonthOfYear = Month(BDate)
myPattern.StartTime = #12:00:00 AM#
myPattern.Duration = 1440 'Set duration to 24hours
myPattern.PatternStartDate = BDate 'Recurrence startdate
myPattern.Save 'Save the recurrence-pattern
myAppt.ReminderSet = False 'Disable reminder
myAppt.Save 'Save the new appointment
myAppt.Close 'Close the appointment
Set myPattern = Nothing
Set myAppt = Nothing
Set myOlApp = Nothing
End Sub


/Henrik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top