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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove buttons from monthcalendar

Status
Not open for further replies.

drey8

Programmer
Aug 31, 2004
17
US
How can i hide or remove 1 or 2 of the buttons (next/previous month) in the MonthCalendar Control ?

Is there a way to do it ?

thank you
 
I've never looked into the MonthCalendar control but I have used this tactic on the CrystalReportsViewer control. You might be able to get at the child controls through the Controls collection of the MonthCalendar. This will only work if the MonthCalendar is truely composed of .net controls and not just a wrapper for a Win API common control.

For example:

Code:
//Initialized elsewhere
MonthCalendar mth;

//You'll have to enter break mode and explore the controls
//collection to determine the actual indices for the
//button controls if they are even present.
//They may even be a child of a child control so you might
//have to go a few layers deep.
((Button) mth.Controls[0]).Visible = false;
((Button) mth.Controls[1]).Visible = false;

Might be worth a try!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top