RadioButtons - text vertical positioning

Caravelle

Active Member
Licensed User
Longtime User
Please see the attached screenshot from my Asus TF101 Transformer.

There are 2 sets of 4 RadioButtons, each set on a panel. On both panels the top three RadioButtons have their text raised above the centre of the button, but the bottom one has the text at the same level as the centre of the button.

The layout was designed using the Designer, which shows that the Text Vertical Alignment attribute is set to CENTER_Vertical in all 8 cases (which is what I want).

Can anyone suggest why the Vertical Alignment setting doesn't appear to be working in the top three RadioButtons in each set ?

Thanks

Caravelle
 

Attachments

  • FileMover.jpg
    FileMover.jpg
    64 KB · Views: 350

manios

Active Member
Licensed User
Longtime User
Maybe there are some extra space characters at the end of the top three strings?
 
Upvote 0

Caravelle

Active Member
Licensed User
Longtime User
Yes, that's sort of the answer, though it has taken me some time to work out exactly what was going on. I spent half a day before posting the message trying to work out if there were extra spaces and couldn't find any :BangHead:. There are no extra spaces, but there is a CRLF !

If you see my post today "Free space on removable cards" you'll appreciate that I import a small bit of text from a file on the card to add to the basic RadioButton text. The process of checking if the file exists...
B4X:
If File.Exists("/Removable/SD","ID.txt") Then
is also a handy way of telling if a card is in fact inserted in the slot (I haven't found any other way), and decides if the relevant RadioButton is going to be enabled and also what colour the text is - "grayed out" if not present. If the card is present its ID from the file is also added to the RadioButton text, eg:
B4X:
rb_from_SDCard.Text = rb_from_SDCard.Text & " " & TagStr

What I did not realise is that the line
B4X:
TagStr = File.ReadString("/Removable/SD","ID.txt")
would include a CRLF at the end of the ID string, though why there doesn't seem to be a CRLF in the case of the MicroSD card when there is on the others remains a mystery. So
B4X:
If Right(TagStr, 1) = Chr(10) Then TagStr = Left(TagStr, TagStr.Length-1)
works in all cases to remove the CRLF if present.

Problem solved - eventually.

Cheers

Caravelle
 
Upvote 0
Top