To reproduce: RadButton button = new RadButton(); button.AutoSize = true; button.MaximumSize = new Size(74, 0); button.Text = "Define Horizontal Measurement"; Controls.Add(button); WORKAROUND: set the MaxSize property of the border primitive to the same value as the MaxSize of the control: button.ButtonElement.BorderElement.MaxSize = new Size(74, 0);
FIX. RadButton does not indicate that it is pressed when it is clicked with key instead of clicking with mouse
IMPROVE. RadRadioButton should take its parent BackColor (not the form color) when its BackColor property is set to Transparent.
FIX. RadRadioButton shape can not be set with Office2010 themes COMMENT. In order to achieve the required design all Office2010 themes use Image Shapes. When an Image Shape is applied to an element, its shape cannot be customized. Thus, the behavior observed in the QSF > Buttons > RadRadioButtons demo, i.e. custom shapes cannot apply to the RadioMark and the CheckMark, is expected.
To reproduce add RadDock to a form and use the following code on a button click. DocumentWindow document = new DocumentWindow(); radDock1.AddDocument(document); document.TabStripItem.ShowCloseButton = true; document.TabStripItem.CloseButton.Image = image1; document.TabStripItem.CloseButton.ImageHovered = image2; document.TabStripItem.CloseButton.ImageClicked = image3; The result is that instead of having three different images for the different states, only the main Image is displayed.
The theme is not applied properly when the button is toggled off.
Setting the Font property of RadButton will not change the font in all states of the control. Currently, the issue can be avoided through setting the Font property of the ButtonElement.
Parse event of the property binding is not fired when you change the ToggleState value of RadToggleButton: Workaround: private void Form1_Shown(object sender, EventArgs e) { Binding b = new Binding("ToggleState", vm, "IsToggleSet", true, DataSourceUpdateMode.OnPropertyChanged); b.Format += new ConvertEventHandler(b_Format); b.Parse += new ConvertEventHandler(b_Parse); radToggleButton1.DataBindings.Add(b); } void b_Parse(object sender, ConvertEventArgs e) { if (e.DesiredType != typeof(bool) || !(e.Value is ToggleState)) return; ToggleState state = (ToggleState)e.Value; e.Value = (state == ToggleState.On) ? true : false; } void b_Format(object sender, ConvertEventArgs e) { if (e.DesiredType != typeof(ToggleState) || !(e.Value is bool)) return; bool isToggleOn = (bool)e.Value; e.Value = isToggleOn ? ToggleState.On : ToggleState.Off; }
Add DefaultItem property in the property grid and allow to set it in design time
this.radButton1.ButtonElement.ImagePrimitive.SvgImage = RadSvgImage.FromFile(@"..\..\image.svg");
this.radButton1.TextImageRelation = TextImageRelation.TextBeforeImage;
this.radButton1.ButtonElement.ImagePrimitive.ImageLayout = ImageLayout.Zoom;
this.radButton1.ButtonElement.ImagePrimitive.StretchVertically = true;
this.radButton1.ButtonElement.ImagePrimitive.StretchHorizontally = true;
Coping RadDropDownButton in design time leads to improperly distributed items collection.
To reproduce, create a RadButton on a form with the below settings. The image is any 32x32 image. this.radButton1.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radButton1.Image = global::TestPopup.Properties.Resources.Image32x32; this.radButton1.Location = new System.Drawing.Point(13, 13); this.radButton1.Size = new System.Drawing.Size(131, 44); this.radButton1.Text = "The Quick Brown Fox"; this.radButton1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.radButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.radButton1.TextWrap = true;
Just like in the case of RadCheckBox, RadToggleButton has a few states. Therefore, we need to add the possibility in Visual Style Builder to style the RadToggleButton when it is disabled and taking into consideration the toggle state (on/off)
When image is being inserted to the ActionButton in RadSplitButton the ArrowButton might get overlaped if the text of the ActionButton is very long. Workaround is to subtract the width of the image from the width of the text manually. int actionButtonWidth = radSplitButton1.DropDownButtonElement.ActionButton.Size.Width; int imageWidth = 40; // Sample rate should be equal to the width of the image in pixels int desiredTextWidth = actionButtonWidth - imageWidth; radSplitButton1.DropDownButtonElement.ActionButton.TextElement.MaxSize = new Size(desiredTextWidth, 0); radSplitButton1.DropDownButtonElement.ActionButton.TextWrap = true;
RadCheckBox can be checked by the right mouse button
RadSplitButton does not get a focus rectangle when focus by the Tab key. One should first click the action part and then the focus rectangle will appear.. The current workaround is: public class MyRadSplitButton : RadSplitButton { protected override void OnEnter(EventArgs e) { base.OnEnter(e); this.DropDownButtonElement.ActionButton.Focus(); } }
When a RadCheckBox is in Indeterminate state, the user should be able to see a square instead of checkmark.
Please refer to the attached sample project and gif file. The text gets clipped sometimes when resizing the form. It may become even blurry. This problem is observed with the MS Form, but it is not reproducible with RadForm. Workaround: use a RadForm UPDATED: a second project is attached (00393359CheckBoxDisabledUPDATED.zip). The MissingCheckBoxesText.gif illustrates the incorrect behavior. In this case, the UseCompatibleTextRendering property is set to false. Workaround for the second case: instead of setting the RadCheckBox.Enabled property to false, disabled the check primitive and make the text gray as follows: private void radButton1_Click(object sender, EventArgs e) { for (int i = 0; i < 30; i++) { RadCheckBox cb = new RadCheckBox(); cb.Text = "RadCheckBox " + i; cb.Location = new Point(10, i * 30); cb.ButtonElement.CheckMarkPrimitive .Enabled = false; cb.ButtonElement.TextElement.ForeColor = Color.Gray; cb.ButtonElement.ShouldHandleMouseInput = false; cb.UseCompatibleTextRendering = false; this.Controls.Add(cb); } }
The same case is valid for RadToggleButton as well. To reproduce: use the following custom RadCheckBox. You will notice that the ToggleStateChanging, ToggleStateChanged, PropertyChanged, CheckStateChanging, CheckStateChanged won't fire anymore: public class MyCheckBoxElement : RadCheckBoxElement { protected override Type ThemeEffectiveType { get { return typeof(RadCheckBoxElement); } } } public class MyCheckBox : RadCheckBox { protected override RadButtonElement CreateButtonElement() { return new MyCheckBoxElement(); } public override string ThemeClassName { get { return typeof(RadCheckBox).FullName; } } } Workaround: public class MyCheckBoxElement : RadCheckBoxElement { protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { return; } base.OnKeyDown(e); } protected override Type ThemeEffectiveType { get { return typeof(RadCheckBoxElement); } } } public class MyCheckBox : RadCheckBox { protected override RadButtonElement CreateButtonElement() { MyCheckBoxElement checkBox = new MyCheckBoxElement(); checkBox.ToggleStateChanging += new StateChangingEventHandler(ButtonElement_ToggleStateChanging); checkBox.ToggleStateChanged += new StateChangedEventHandler(ButtonElement_ToggleStateChanged); checkBox.PropertyChanged += new PropertyChangedEventHandler(res_PropertyChanged); checkBox.CheckStateChanging += new CheckStateChangingEventHandler(res_CheckStateChanging); checkBox.CheckStateChanged += new EventHandler(res_CheckStateChanged); return checkBox; } private void res_CheckStateChanged(object sender, EventArgs e) { base.OnCheckStateChanged(e); } private void res_CheckStateChanging(object sender, CheckStateChangingEventArgs args) { base.OnCheckStateChanging(args); } private void res_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "IsChecked") { base.OnNotifyPropertyChanged("IsChecked"); } } private void ButtonElement_ToggleStateChanged(object sender, StateChangedEventArgs args) { base.OnToggleStateChanged(args); base.OnNotifyPropertyChanged("Checked"); base.OnNotifyPropertyChanged("CheckState"); base.OnNotifyPropertyChanged("ToggleState"); } private void ButtonElement_ToggleStateChanging(object sender, StateChangingEventArgs args) { base.OnToggleStateChanging(args); } public override string ThemeClassName { get { return typeof(RadCheckBox).FullName; } } }