NDateTimePicker with skins and palettes


Author
Message
Brad Swearingen
Brad Swearingen
Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)
Group: Forum Members
Posts: 53, Visits: 3

I've just started using an NDateTimePicker and noticed a couple of things with how it looks:

1) When I use a skin most of the skins do not draw a border around the calendar drop-down button when the control does not have the focus.  It seems there at least needs to be a line on the left of the button to separate the date with the button.  I've attached a screenshot which shows an example of this.

2) The NDateTimePicker does use the skin or palette but there are many colors that are not utilized by the widget.  Thus they stay the default colors regardless of which skin/palette I use.  I expected this widget to take advantage of the skin/palette fully like the rest of the N* widgets do.  Is there an expectation that I have to code for a palette/skin change event myself and then change the widgets Calendar***Color Properties?  Another way?

I'm using the 11.1.17.12 build.


Attachments
datetimepicker.gif (253 views, 5.00 KB)
Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Brad,

The problem with the width of the NDateTimePicker drop down button is because on machines running OS after XP and EnableVisualStyles is called there is additional calendar icon.
This make the button wider and we measure it so when we draw our button on top of the original to has the same size.
Currently, when the OS is higher than XP we take the width of SystemInformation.IconSize.Width + SystemInformation.BorderSize.Width * 2 to measure the width of our button.
We will add a additional condition to check whether EnableVisualStyles method was call to handle this case too.

To work around this problem you can override NDateTimePicker.GetDropDownButtonWidth method as follows:

protected override int GetDropDownButtonWidth()
{
   if (System.Environment.OSVersion.Version.Major > 5 && Application.RenderWithVisualStyles == false)
   {
         return SystemInformation.VerticalScrollBarWidth;
   }

   return base.GetDropDownButtonWidth();
}

Hope this helps.

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search