Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Changing appointment colors on the fly (Read 2525 times)
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Changing appointment colors on the fly
Mar 9th, 2012 at 5:08pm
Print Post  
Hi Meppy,
In my application I have production runs for various products scheduled throughout the week. So each run is an appointment to my calendar. When the user clicks on a run (appointment) I want to set the color of all other runs matching the item being produced to the same color. I save the run information in the app tag. I have tried the following placed inside calendar.ItemClick

theSelectedRunInfo = e.Item.Tag
theTargetItem = theSelectedRunInfo.ItemNumber
For Each app As Apointment In calendar.Schedule.Items
  theRunInfo = app.Tag
  if theRunInfo.ItemNumber = theTargetItem then
    app.Style.Brush = New MindFusion.Drawing.HatchBrush(....)
  end if
Next

(Note, I typed the above so it is pseudo code for what I am doing).
The problem is that when I run this, the selected item looses its selection and drag drop does not work (seems to be dragging but the selected item remains still).

Am I doing this correctly or is there a better way. In the end, I just want to color the other runs (appointments) but have the functionality of selection, drag/drop etc. unchanged for the selected item.

I hope this makes sense.

TIA,
John
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: Changing appointment colors on the fly
Reply #1 - Mar 9th, 2012 at 5:36pm
Print Post  
Hi Meppy,
I discovered a bug in my program. I was resetting the calendar in another event that caused the problem. But I am interested if the above process is the best way to handle changing the colors on the fly?

TIA,
John
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Changing appointment colors on the fly
Reply #2 - Mar 11th, 2012 at 7:33am
Print Post  
Hi John,

Changing the item appearance through the item's Style (SelectedStyle, PointedStyle, and so on) is most appropriate.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint