Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ResourceView: Custom lane backcolor (Read 2934 times)
LVV
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Mar 24th, 2020
ResourceView: Custom lane backcolor
Mar 25th, 2020 at 9:33am
Print Post  
Hi,

I have a calendar which is set to CurrentView = ResourceView
In the ResourceViewSettings, the ViewStyle = Lanes.
The BottomTimelineSettings is set to Unit = Hour

I want to set the backcolor of all cell in lanes before 08:00 and after 17:00 to a certain backcolor.

How can this be done ?


Thanks in advance.
  
Back to top
 
IP Logged
 
Forum Admin
YaBB Administrator
*****
Offline


Rock and Roll

Posts: 685
Joined: Apr 6th, 2003
Re: ResourceView: Custom lane backcolor
Reply #1 - Mar 25th, 2020 at 11:01am
Print Post  
Hi,

You can use custom drawing this way:

Code
Select All
_calendar.Draw += _calendar_Draw;
_calendar.CustomDraw = CustomDrawElements.ResourceViewCell;
 



The event handler is:

Code
Select All
private void _calendar_Draw(object sender, DrawEventArgs e)
{
	if (e.Date.Hour > 8 && e.Date.Hour < 19)
	{
		Pen pen = new Pen(Color.DarkGoldenrod);
		Brush brush = new SolidBrush(Color.FromArgb(75, Color.Goldenrod));
		Rectangle bounds = e.Bounds;
		bounds.Width -= 1;
		bounds.Height -= 1;

		e.Graphics.FillRectangle(brush, bounds);
		e.Graphics.DrawRectangle(pen, bounds);

		brush.Dispose();
		pen.Dispose();
	}
}
 



The result on the Resources sample from the installation samples is visible in the attached file.

Kind Regards,
Iva
  

resource_view_cells.png ( 93 KB | 201 Downloads )
resource_view_cells.png
Back to top
WWW  
IP Logged
 
LVV
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Mar 24th, 2020
Re: ResourceView: Custom lane backcolor
Reply #2 - Mar 25th, 2020 at 11:24am
Print Post  
Works great !

Thanks for the quick reply !
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint