Solved

Large Radio Buttons

Posted on 2011-03-06
4
554 Views
Last Modified: 2012-05-11
I have a site where people take tests, answering questions by clicking on the button.

Does anyone know of a control that will display larger (much larger) radio buttons or squares (checkboxes that behave like radio buttons)?

I'd be most happy with a .NET control solution but would also be ineterested in a jQuery or Ajax solution.

We occasionally get complaints from customers that it's hard to click on the buttons and I personally am starting to have difficulty clicking on them sometimes.

0
Comment
Question by:ce4LessUser
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
Matthew Kelly earned 500 total points
ID: 35047315
You should be able to just set the font-size of the RadioButton or RadioButtonList to make it larger.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication4._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <p>Text above is normal size</p>
    <div>
        <asp:RadioButtonList style="font-size:200%;" ID="List" runat="server">
            <asp:ListItem Text="Item # 1"  Value="1" />
            <asp:ListItem Text="Item # 2"  Value="2" />
            <asp:ListItem Text="Item # 3"  Value="3" />
        </asp:RadioButtonList>
    </div>
    <p>Text below is normal size</p>
    </form>
</body>
</html>

Open in new window

Untitled.jpg
0
 

Author Comment

by:ce4LessUser
ID: 35059242
That makes the text larger but I was hoping to get the actual circles larger.

Any ideas?
0
 
LVL 12

Expert Comment

by:omegaomega
ID: 35063573
Hello, ce4LessUser,

Please see the following snippet for an idea.  For scale factors s other than 2, you will need to adjust the size of the TranslateTransform.  

Cheers,
Randy

Public Class LargeRadioButton

    Inherits RadioButton

    Protected Overrides Sub onpaint(ByVal pevent As System.Windows.Forms.PaintEventArgs)
        Dim sngScale As Single = 2.0
        pevent.Graphics.Clear(Me.BackColor)
        pevent.Graphics.TranslateTransform(0, -CSng(Me.Height / 2))
        pevent.Graphics.ScaleTransform(sngScale, sngScale)
        MyBase.OnPaint(pevent)
    End Sub

    Public Overrides Property AutoSize() As Boolean
        Get
            Return False
        End Get
        Set(ByVal value As Boolean)
            MyBase.AutoSize = False
        End Set
    End Property

    Public Sub New()
        MyBase.New()
        Me.UseCompatibleTextRendering = True
    End Sub

End Class

Open in new window

0
 

Author Closing Comment

by:ce4LessUser
ID: 35315627
This was a good solution. I wanted the buttons to get bigger but this is good too.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now