Align Radio Button text and button

How do you get the text to line up with the button when it is small text?

I have a button:

<asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style=" font-size: 
11px " runat="server" />

If the button is the default size where the text is large, it lines up so 
the button is at the middle of the text.  But when you change the text to a 
small font, it is still positioned in the same place but since the text is 
smaller, the button is now aligned with the top of the text because the text 
is now shorter.

Is there a way to get the text move up so that the button is aligned with 
the middle of the text?

Thanks,

Tom 


0
tshad
11/18/2009 1:59:31 AM
dotnet.framework.aspnet 1425 articles. 0 followers. Follow

6 Replies
999 Views

Similar Articles

[PageSpeed] 20

"tshad" <toms@pdsa.com> wrote in
news:uR3VGL$ZKHA.5472@TK2MSFTNGP02.phx.gbl: 

> How do you get the text to line up with the button when it is small
> text? 
> 
> I have a button:
> 
> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
> font-size: 11px " runat="server" />
> 
> If the button is the default size where the text is large, it lines up
> so the button is at the middle of the text.  But when you change the
> text to a small font, it is still positioned in the same place but
> since the text is smaller, the button is now aligned with the top of
> the text because the text is now shorter.
> 
> Is there a way to get the text move up so that the button is aligned
> with the middle of the text?

If I am reading you correctly, you have a need to vertically align the 
text? If so, you can do this in the tag, or if you are using CSS (as in the 
image/table problem), you can use the vertical-align attribute:
http://www.w3schools.com/Css/pr_pos_vertical-align.asp

Peace and Grace,
Greg

-- 
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
|      Think outside the box!             |
*******************************************
0
Gregory
11/18/2009 4:17:10 PM
On Nov 18, 2:59=A0am, "tshad" <t...@pdsa.com> wrote:
> How do you get the text to line up with the button when it is small text?
>
> I have a button:
>
> <asp:RadioButton id=3D"rdbClients" GroupName=3D"SetupDisplay" style=3D" f=
ont-size:
> 11px " runat=3D"server" />
>
> If the button is the default size where the text is large, it lines up so
> the button is at the middle of the text. =A0But when you change the text =
to a
> small font, it is still positioned in the same place but since the text i=
s
> smaller, the button is now aligned with the top of the text because the t=
ext
> is now shorter.
>
> Is there a way to get the text move up so that the button is aligned with
> the middle of the text?
>
> Thanks,
>
> Tom

You can try to specify positioning, like

style=3D"position:relative; top:-5px;"
0
Alexey
11/18/2009 4:23:53 PM
"Gregory A. Beamer" <NoSpamMgbworld@comcast.netNoSpamM> wrote in message 
news:Xns9CC76852ACFBBgbworld@207.46.248.16...
> "tshad" <toms@pdsa.com> wrote in
> news:uR3VGL$ZKHA.5472@TK2MSFTNGP02.phx.gbl:
>
>> How do you get the text to line up with the button when it is small
>> text?
>>
>> I have a button:
>>
>> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
>> font-size: 11px " runat="server" />
>>
>> If the button is the default size where the text is large, it lines up
>> so the button is at the middle of the text.  But when you change the
>> text to a small font, it is still positioned in the same place but
>> since the text is smaller, the button is now aligned with the top of
>> the text because the text is now shorter.
>>
>> Is there a way to get the text move up so that the button is aligned
>> with the middle of the text?
>
> If I am reading you correctly, you have a need to vertically align the
> text? If so, you can do this in the tag, or if you are using CSS (as in 
> the
> image/table problem), you can use the vertical-align attribute:

I already tried that:

<asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style=" font-size: 
11px; vertical-align: top " runat="server" />

but the text is still at the bottom.

Tom

> http://www.w3schools.com/Css/pr_pos_vertical-align.asp
>
> Peace and Grace,
> Greg
>
> -- 
> Vote for Miranda's Christmas Story
> http://tinyurl.com/mirandabelieve
>
> Twitter: @gbworld
> Blog: http://gregorybeamer.spaces.live.com
>
> *******************************************
> |      Think outside the box!             |
> ******************************************* 


0
tshad
11/18/2009 6:05:57 PM
"Alexey Smirnov" <alexey.smirnov@gmail.com> wrote in message 
news:adf3e931-7425-4b75-a51a-11458fca408e@37g2000yqm.googlegroups.com...
On Nov 18, 2:59 am, "tshad" <t...@pdsa.com> wrote:
> How do you get the text to line up with the button when it is small text?
>
> I have a button:
>
> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style=" 
> font-size:
> 11px " runat="server" />
>
> If the button is the default size where the text is large, it lines up so
> the button is at the middle of the text. But when you change the text to a
> small font, it is still positioned in the same place but since the text is
> smaller, the button is now aligned with the top of the text because the 
> text
> is now shorter.
>
> Is there a way to get the text move up so that the button is aligned with
> the middle of the text?
>
> Thanks,
>
> Tom
>
>You can try to specify positioning, like
>
>style="position:relative; top:-5px;"

This only works (same with Gregs suggestion) if you use a separate control 
such as a Label and then put the style on that.  But then the text is about 
a couple of characters to the right and not right up to the button as it is 
if the text is part of the control.

Neither way works if the text is part of the RadioButton control.

Thanks,

Tom


0
tshad
11/18/2009 6:27:20 PM
"tshad" <toms@pdsa.com> wrote in
news:OI8oInHaKHA.4932@TK2MSFTNGP02.phx.gbl: 

> I already tried that:
> 
> <asp:RadioButton id="rdbClients" GroupName="SetupDisplay" style="
> font-size: 11px; vertical-align: top " runat="server" />
> 
> but the text is still at the bottom.

Brain went on vacation for a bit there.

There is no real control over alignment between the selection circle (the 
button part) and the text (or at least none that I know of). This is not an 
ASP.NET exclusive problem either, as this is an HTML construct.

Peace and Grace,
Greg

-- 
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
|      Think outside the box!             |
*******************************************
0
Gregory
11/18/2009 6:31:58 PM
On Nov 18, 7:27=A0pm, "tshad" <t...@pdsa.com> wrote:
> "Alexey Smirnov" <alexey.smir...@gmail.com> wrote in message
>
> news:adf3e931-7425-4b75-a51a-11458fca408e@37g2000yqm.googlegroups.com...
> On Nov 18, 2:59 am, "tshad" <t...@pdsa.com> wrote:
>
>
>
>
>
> > How do you get the text to line up with the button when it is small tex=
t?
>
> > I have a button:
>
> > <asp:RadioButton id=3D"rdbClients" GroupName=3D"SetupDisplay" style=3D"
> > font-size:
> > 11px " runat=3D"server" />
>
> > If the button is the default size where the text is large, it lines up =
so
> > the button is at the middle of the text. But when you change the text t=
o a
> > small font, it is still positioned in the same place but since the text=
 is
> > smaller, the button is now aligned with the top of the text because the
> > text
> > is now shorter.
>
> > Is there a way to get the text move up so that the button is aligned wi=
th
> > the middle of the text?
>
> > Thanks,
>
> > Tom
>
> >You can try to specify positioning, like
>
> >style=3D"position:relative; top:-5px;"
>
> This only works (same with Gregs suggestion) if you use a separate contro=
l
> such as a Label and then put the style on that. =A0But then the text is a=
bout
> a couple of characters to the right and not right up to the button as it =
is
> if the text is part of the control.
>
> Neither way works if the text is part of the RadioButton control.
>
> Thanks,
>
> Tom- Hide quoted text -
>
> - Show quoted text -

Tom,

the funny thing is that it is a Label. If you look at the source code
generated, you will see something like this

<input id=3D"rdbClients" type=3D"radio" name=3D"SetupDisplay"
value=3D"rdbClients" /><label for=3D"rdbClients">This is a text string</
label>

Where text from the Text property goes between Label HTML tags. This
means that you need to add CSS style as I told you above

 <style>
        label
        {
            position: relative;
            top: -5px;
        }
    </style>

and this should fix the issue. Please try it.

It was not clear from the beginning where your text is since your
sample tag doesn't include Text property....
0
Alexey
11/26/2009 8:52:24 AM
Reply:

Similar Artilces:

Decimal alignment
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) How do I align decimals in a word document? I know it has something to do with setting tabs, but I can't seem to get it right when I tried to figure it out myself! Thanks so much. Why are you trying to "figure it out" for yourself?... That's what Help is for :-) See the topic: Set tab stops Regards |:>) Bob Jones [MVP] Office:Mac On 2/7/10 6:37 PM, in article 59bb26da.-1@webcrossing.JaKIaxP2ac0, "brielle78@officeformac.com" <brielle78@officeformac.com> wrote: > Version: ...

Radio Button
I have a form someone created in Excel and somehow three buttons are linked together so that if I click on one, it selects the one I click on and clears one selected before. Is there a way to have it clear the button that was selected if I click on the same button again. As it is, I cannot clear all the buttons once a button is selected. Hi This is what radiobuttons (option buttons) are for. Either Male or Female, no None or Both or Not sure yet or Refuse to answer. For independent choices (Vegetarian, Blonde, Plays guitar, ... ) use checkboxes. HTH. Best wishes Harald "Debb...

no send button
My "Send" button has disappeared! I'm using Publisher>send this page as message. When the screen pops up with the To: Cc: Bcc: - and I add the Address, Subject etc. there is no "Send" button or option - either on the screen or under send message as an email in the File Menu - it disappeared! Have MS Outlook properly installed as my primary email. ...

Chart Title or Text Box Linked to cell & sheet
I need to create charts from data collected via a com port. As i stands, the data is written to sheet 1. Chart 1 is ready to plot dat as it is written. Once the data is complete, I copy sheet 1 and char 1. This results in sheet 1(2) and Chart 1(2). All references to shee 1 on the newly created chart 1(2) automatically changes to refer t sheet 1(2). This applies to data ranges, Chart Title, Axis names. When creating text boxes refering to sheet1!$A$1, the reference doe not automacially change to sheet 1(2)!$A$1. Can this be done? If not, can I create multiple chart titles? Any help o...

Create a button to find the next record
Hi I am trying to create a button to find the next record for a particular studentID. There is a main form and subform. I want to be able to find all relevent subforms for a particular student. The master link id is STUDENTID and the child link id is STUDENTID_FK. So for student #1, when I click on the subform and click on the button, it would cycle through all this student's records. What is the best way to set up this button? Thank you for your help in advance. You already have one that is built in. Just click the navigation button right of the record number ...

Establish Default Titles For Drop Windows And Reset Button
I have a data entry sheet used for various forms by numerous people. I have drop down windows with standard info. I would like to title each drop down window and use it as a default. I would like to establish a "RESET" button to bring the data sheet back to the default titles. Any ideas how to establish defaults and set up a "RESET" button? -- travelersway ------------------------------------------------------------------------ travelersway's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=17623 View this thread: http://www.excelforum.co...

how to save a file as ASCII: expanded comma delimited text (.exp).
How do I save and excel file as an .exp file, or as they requested an ASCII: expanded comma delimited text (.exp) ...

Copying text from Word to Outlook
Can someone please tell me how to copy text from a Word document and paste it into the "To" field of an Outlook email? Thanks! robert.stone@oup.com <robert.stone@oup.com> wrote: > Can someone please tell me how to copy text from a Word > document and paste it into the "To" field of an Outlook > email? Thanks! With both the Word and Outlook compose window open, click and select the material from the Word document and then click the "Copy" button in Word's tool bar. Next, select the Outlook window, click in the To field and either right-clic...

Four-up postcards not aligned right
I'm using Publisher 2003 to print postcards four to a page. They are "off" by about 1/4 inch to the left. This isn't awful for the two postcards on the left side of the page, but the two on the right side of the page are unusable. How do I fix this problem? I used Publisher's postcard format, 4.25" by 5.5". I've tweaked the postcard size down a bit in Page Setup (to 5.35") in order to insert a .1" side margin and a .2" gap between the two postcards (it's called a "horizontal gap," based on a portrait orientation, even ...

The send email button???
Why would this not be working from the Rich Client? what happens when you click it - any errors? "Jake Horn" <jhorn@order4chaos.com> wrote in message news:eQqonkzvDHA.684@TK2MSFTNGP09.phx.gbl... > Why would this not be working from the Rich Client? > > ...

Concatenate text from columns
How can I concatenate text in colB? ColA has 2 markers C and * Whenever C is followed by * I need to unite the text fields in ColB So, for the data below I want ColA ColB C Text1 Text1a C Text2 Text2a Text2b Text2c ColA ColB C Text1 * Text1a cont'd C Text2 * Text2a cont'd * Text2b cont'd * Text2c cont'd C Text3 Hope this makes sense! Thbe easy method is to use a fromula in the worksheet. Something like this in cell C1 =if(A2="*",B1&B2,"") Then copy formula down column C Next Copy colum...

convert text into date
can any one help me i have data in excel like 436,or 1851 i wanted to convert this text format into time and date format so actully i wanted it to be as 4:36 AM or 18:51 PM, I found one solution if you manually put ":" between "4" and "36" then format cell as time, this will work but i have a lot of data, is there any formula to put ":" between charactors thanx shabbir Hi in adjancent cell try the following formula =TIME(LEFT(A1,1+(LEN(A1)=4)),RIGHT(A1,2),0) and format this cell as time -- Regards Frank Kabel Frankfurt, Germany "arshab1&qu...

how to catch values from a texts to use it as values
Hi. I want to create a formula system in my access program. So I using a little funcionality that I already have in my system that make calcs using a prompt command. So, I'm trying to load a text value that as the formula: (([Field1]*[field2]*[field3]*[field4])/[field5]) but this don't work because the form cannot use the text values, it uses text, imagine this: I havee in this fields: field1: 10 field2: 30 field3: 2 field4: 14 field5: 12 I want that my value is: 700 My problem is that the form cannot understand that it should not use the text but the inside numbers. I also...

OWA Change Password Button Disappears
Hi, I have 1 front-end 2003 OWA server connected to various Exchange 2003 back-end servers. I have enabled the Change passowrd button via the registry change, and the creation of the IISadmpwd virtual directory in IIS. This worked fine, and the change passowrd button worked ok. All of a sudden the Change Password button dissapeared from the Option menu in OWA. The registry cahnge and virtual directory is still intact and running. Any ideas on why the OWA Change Password button would just disappear? Thanks I'm assuming you're talking about the following registry key: HKLM\Syst...

Excel will not allow me to change alignment
I have a worksheet in which Excel does not allow me to change the alignment of a range of cells from, say, left-justified to centered. I am experienced with Excel/VBA and have not seen this before. The cells are not protected and do contain numerical data. If I add a leading apostrophe to the cell values to have them treated as strings, I can then align the cells however I like. When those cells contain numerical data, Excel will not allow me to change the alignment from left-justified, regardless of whether I use a toolbar, the Format tab, or VBA. Any ideas? -- zalcjm ---------------...

Text To Date Conversion
Hi I run Excel 2000 I download information from a mainframe into Excel. In cell F5 the data looks like this: 19.11.2007 This is formatted as text and is left aligned. When I try to reformat it to a date (19/11/2007) it does not change. I would like to have a formula in cell N5 that changes the original data to a datevalue. (eg: 19/11/2007) Thanks If column F contains a lot of the "date" values, then you could: Data|Text to columns Fixed width (but don't have any separator lines!) choose Date (dmy order) and finish up Then give the range the date ...

Body text on Outlook 2003
Dear All, I have a problem, that when I have installed MS Office2003, I cant see the body message of any new email!! this is very strange. Best regards, Moh'd Yassin ...

Align
In a cell, Why are texts aligned to the left and numbers aligned to the right in MS Excel spreadsheet? That's the standard for Spreadsheets. Comes in handy when you THINK a cell houses a number and it's left aligned by default. -- Regards Dave Hawley www.ozgrid.com "Diana" <Diana@discussions.microsoft.com> wrote in message news:983520B3-6FA0-4D96-B370-70057F717A55@microsoft.com... > In a cell, Why are texts aligned to the left and numbers aligned to the > right > in MS Excel spreadsheet? hi microsoft chose this as default to mimic ...

Text Highlighting in Yellow (2000) ???
This is a multi-part message in MIME format. ------=_NextPart_000_000B_01C600B3.07A33400 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable People, Is there a way to highlight text in yellow...in Publisher 2000. This is such a basic text function...available in *Word* for example...& = they can't provide this? Thanks, mark4man ------=_NextPart_000_000B_01C600B3.07A33400 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transiti...

Color Coding Text in Calender
I have trouble with color coding my text in Calendar. My calender is from Aug. 2003 - Dec. 2004. I am attempting to color the activities of each staff member. I get half way through the calendar and the text of all the calendar changes to purple. I've tried it several times and now I'm frustrated. PLEASE SOMEONE...HELP ME! Hi - Maybe split the calendar into several files, since it seems to work part way through... M. >-----Original Message----- >I have trouble with color coding my text in Calendar. My >calender is from Aug. 2003 - Dec. 2004. I am attempting ...

Link Command Button
I have 27 Excel workbooks, each of which has a command button to run a program written in Cplus. I presently have this button on each workbook. If the program is changed I would have to go into 27 workbooks to update the program. Is there a way to "LINK" a command button to all 27 workbooks. My first thought is to open a new workbook with just the macro code and assign the command button for all 27 to this workbook. Will this work. Do you see any problems doing it this way or have any suggestions. Thanks Frank Does Cplus mean that it's an executable (*.exe)? Does ...

Formula to return text
Need some help here. I am using excel 2007 and I am merging cells - I cannot figure out a formula to give me the text in 91 columns below the previous text. Ex. Cell G7 = Unbalanced Cell G95 = NVAA What formula can I use to get me the text out of cell G95 using cell G7. Ex G7+what= NVAA(G95). Thanks. Maybe =OFFSET(G7,88,0) -- HTH Bob "casinel1" <casinel1@discussions.microsoft.com> wrote in message news:EEBF975E-7D02-48DC-836C-5E7A11C27389@microsoft.com... > Need some help here. I am using excel 2007 and I am merging cells - I > canno...

How do I make 11.800 convert to 800 as a number not text
I want to drop the 11. and have the cell next to it be 800. I want to then be able to use that 800 and add other numbers to it. I am having two problems, 1) the 11.800 always becomes 11.8 ( I have tried increasing the decimals) and 2) if I have a different number like for example 11.255 by using RIGHT I succeed in getting 255 but as text. Please help. Thank you all in advance --- Message posted from http://www.ExcelForum.com/ Nave, =MOD(A2, 1) * 1000 will give you the 800 from 11.8 -- Earl Kiosterud mvpearl omitthisword at verizon period net -----------------------------------------...

on_change() event for text fields
Is there really no way to assign an event to a text field? We want to be able to have the format saved correctly for phone numbers when they're entered in (###)###-#### I've read some threads about this already and it looks like it cannot be done unless you write an app to constantly check and replace the phone numbers within the database itself. I can do this but it would be nice to know if there was any simpler way of going about this. Thanks in advance. nope, not at all,.....only picklists its kinda stupid too because under text boxes they have the ability to select &qu...

Fault With Tender Buttons (Touchscreen Environment)
Hi there, Getting an error message when the following conditions are met. 1. Using a Voucher Tender Type 2. Using a touchscreen keyboard 3. RMS V2 with latest hotfixes Start a sale and press Tender. Enter the amount into the voucher tender and hit Enter. The prompt box appears requiring user input. At this stage if you try and use a tender button on the touchscreen keyboard, it errors with a run-time error '400' Form already displayed; Cannot be shown modally. and kicks you from the app. This is obviously a very specific error but an error nonethelesss. Anyone seen this before/is ...