01-27-2009 02:06 PM
I'm attempting to use the .net MonthCalendar control in one of my vi's. My goal is to be able to programmatically "highlight" certain dates by changing the background color of the cell, or the color of the text (hopefully both).
I've tried modifying the "BackColor" and "ForeColor" properties, but I can't seem to get any changes to appear on the screen. In researching the class I came across this gem in the msdn website:
"Changing the ForeColor property may not affect the appearance of the MonthCalendar control, depending on the operating system and theme of the computer running the application. For example, changing the ForeColor property of the MonthCalendar control on Windows Vista with the Windows Aero theme does not affect the control appearance. "
...but I've tried in both Vista and XP machines to no avail.
I hope I'm making an easily remidied beginner mistake (I've not done anything with .net controls in LabVIEW to this point), but can someone point me in the right direction or post a snippet of sample code illustrating the proper way for this to be done?
01-27-2009 03:36 PM - edited 01-27-2009 03:37 PM
Works for me. Are you keeping the VI running? Once the VI stops the colors revert back.
01-27-2009 03:41 PM
Yeah the VI was still running, and using your example isn't working either.
Blarg...
Upon loading our VI, though, I am getting a warning:
.NET assembly changed (1 warning)
- Expected Assembly "System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", but found "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089."
Ideas? Anyone? 😞
01-27-2009 03:49 PM
It seems you do not have .NET 1.1 installed. I simply placed the .NET MonthCalendar that is pre-packaged in the palette. The one that's there is the .NET 1.1 version. You can easily use the .NET 2.0 version instead. In fact, that's what happened when you opened the VI on your computer.
Why don't you post your VI so we can take a look at it?
01-27-2009 06:06 PM
Gladly, though there's not much to post. This issue is stopping my development before it gets started, unfortunately.
I'm beginning to suspect this is a Vista issue. Would you mind telling me if you're using Vista?
The comment on the MSDN info page seems to suggest there's a certain theme I have to set, but I've tried all the Vista themes to no avail.
01-27-2009 08:32 PM
12-04-2013 03:15 AM
not working for me with win 7[labview 2012].!!!
any help.......?
10-25-2018 03:35 AM - edited 10-25-2018 03:56 AM
You will have to enable the 'VisualStylesState' of the 'System.Windows.Forms.Application' . You can use the VI snippet attached with this post. Remember to change the state and close the reference at the end of the use. Here is the link to the example from which I got this information: