8 Answers, 1 is accepted
Thanks for contacting us and for your question.
You can easily increase the size of the box in the RadCheckBox control by setting the MinSize property of the CheckPrimitive which is part of the element tree that builds up the visual hierarchy of the control.
To set the MinSize property of the CheckPrimitive you can follow these steps:
1. Open a Form in Visual Studio and add a RadCheckBox control from the Toolbox.
2. Select the control and from its Smart Tag start Edit UI Elements dialog.
3. In the dialog that shows up select the CheckPrimitive node from the TreeView on the left
4. Set the MinSize property according to your needs from the property grid on the right.
5. You can also set the CheckPrimitiveStyle property to adjust the style of the check mark which is painted in the box.
I have attached some screenshots to guide you through these steps.
Best wishes,
Deyan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Following your instructions, I was able to increase the size of the check box to 64 by 64 pixels. Which is what I wanted. However, the checkmark itself is still tiny.
In the UI for WinForms version, is there a way to increase the size of the checkmark itself?
Hi, Clint,
Feel free to use the following code snippet in order to enlarge RadCheckBox:
this.radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.UseFixedCheckSize = false;
this.radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.MinSize = new Size(100, 100);
this.radCheckBox1.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
Weird. I added a new test checkbox and when the form launches I run this method:
/// <summary>
/// Builds the checkbox.
/// </summary>
private void BuildCheckbox()
{
radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.UseFixedCheckSize = false;
radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.MinSize = new Size(100, 100);
radCheckBox1.ToggleState = ToggleState.On;
}
Which is basically your code snippet. However, I see this:
So the check box is bigger, but the checkmark is still tiny. I do see that the theme that was set by default is different to your sample, so would a theme override this? Would I have to remove any theme settings to allow the code to work?
Got it. Had to set the ThemeName field for that control to "ControlDefault" and it's looking exactly like you have it.
I guess that fluent theme is somehow overriding what you've set in code.
According to the provided screenshot, it seems that you are using the Fluent theme. Indeed, with this theme, the previously provided code snippet doesn't produce the illustrated result. This is because the Fluent theme uses an image with fixed 14x14 size for the checkmark. You can apply a bigger image to the RadCheckBox.ButtonElement.CheckMarkPrimitive.ImageElement or use the ControlDefault theme as you have already found out.
Feel free to use this approach which suits your requirements best.
This is a forum thread for the WinForms controls, so I suggest we do not mix the content with the ASP.NET related questions.
As a quick reply to your question - no, this is not possible to change the size of the checkbox html element.
Regards,
Veskoni
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Hello Deyan,
How can i increase MinSize of RadioPrimitive of RadRadioButton(winforms) dynamically in VB code
I have created dynamic radradio buttons in win form and i want to increase its MinSize from RadioPrimitive
Please help!!
Thank you for writing.
You can access the radio primitive and change its minimum size this way:
RadioPrimitive primitive =
this
.radRadioButton1.ButtonElement.CheckMarkPrimitive.FindDescendant<RadioPrimitive>();
if
(primitive !=
null
)
{
primitive.MinSize =
new
Size(primitive.Size.Width * 2, primitive.Size.Height * 2);
}
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik by Progress
Hello Sir,
Thank for your reply
I wrote below code,
Dim rdOptionButton = New RadRadioButton
rdOptionButton.Text = dr("Options")
rdOptionButton.Name = dr("Doc_Id")
rdOptionButton.Font = New Font("Segoe UI", 12, FontStyle.Bold)
rdOptionButton.AutoSize = True
rdOptionButton.Location = New System.Drawing.Point(x, y)
rdOptionButton.EnableTheming = False
Dim primitive As RadioPrimitive = rdOptionButton.ButtonElement.CheckMarkPrimitive.FindDescendant(Of RadioPrimitive)()
If primitive IsNot Nothing Then
primitive.MinSize = New Size(primitive.Size.Width * 2, primitive.Size.Height * 2)
End If
Me.RadPanel1.Controls.Add(rdOptionButton)
And i got error for this
Error is :
Error12'CheckMarkPrimitive' is not a member of 'Telerik.WinControls.UI.RadRadioButtonElement'
Please Help
Thank you for writing.
The CheckMarkPrimitive property was introduced with our Q2 SP1 2016 release. If you are using an older version of the controls you can access element this way:
Dim
primitive
As
RadioPrimitive =
Me
.RadRadioButton1.ButtonElement.FindDescendant(Of RadRadiomark).FindDescendant(Of RadioPrimitive)()
If
primitive IsNot
Nothing
Then
primitive.MinSize =
New
Size(primitive.Size.Width * 2, primitive.Size.Height * 2)
End
If
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik by Progress
Thank You Sir..!!
It works......