This is a migrated thread and some comments may be shown as answers.

How to increase RadCheckbox size

8 Answers 941 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Veshala
Top achievements
Rank 1
Veshala asked on 03 Aug 2009, 08:17 PM
Hi,

How to increase the size of rectangle box in RadCheckBox control, not the label text.

Thanks
Vanitha

8 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 04 Aug 2009, 07:25 AM
Hello Veshala,

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.
Clint
Top achievements
Rank 1
Iron
Iron
Iron
commented on 15 Sep 2021, 07:14 PM | edited

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?

Dess | Tech Support Engineer, Principal
Telerik team
commented on 16 Sep 2021, 04:52 AM

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; 
Clint
Top achievements
Rank 1
Iron
Iron
Iron
commented on 16 Sep 2021, 03:53 PM

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?

Clint
Top achievements
Rank 1
Iron
Iron
Iron
commented on 16 Sep 2021, 03:55 PM | edited

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.

Dess | Tech Support Engineer, Principal
Telerik team
commented on 21 Sep 2021, 06:08 AM

Hi, Clint, 

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.
0
Kurt Kremer
Top achievements
Rank 1
answered on 16 Mar 2010, 01:11 AM
Is it correct that you cannot change the checkbox size for checkboxes in the ASP.NET tree control?
0
Veselin Vasilev
Telerik team
answered on 18 Mar 2010, 02:39 PM
Hi Kurt Kremer,

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.
0
Pawan
Top achievements
Rank 1
answered on 20 Oct 2016, 05:02 AM

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!!

0
Hristo
Telerik team
answered on 20 Oct 2016, 01:47 PM
Hi Pawan,

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
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Pawan
Top achievements
Rank 1
answered on 21 Oct 2016, 02:48 AM

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

0
Hristo
Telerik team
answered on 21 Oct 2016, 07:18 AM
Hi Pawan,

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
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Pawan
Top achievements
Rank 1
answered on 21 Oct 2016, 07:30 AM

Thank You Sir..!!

It works......

Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Veshala
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Kurt Kremer
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Pawan
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or