Whiteangel Posted April 2, 2014 Report Share Posted April 2, 2014 Boas pessoal, precisar de saber como posso centrar, ou colocar no topo o texto de um botao. Mas sem ser nas propriedades, ser por código With Btt1cat .Font = New Font("Palatino Linotype", 14, FontStyle.Regular) End With Link to comment Share on other sites More sharing options...
bids Posted April 2, 2014 Report Share Posted April 2, 2014 não entendi! colocar no topo o texto de um botão? Ajude-me? Link to comment Share on other sites More sharing options...
vikcch Posted April 3, 2014 Report Share Posted April 3, 2014 Olá, com este code consegues sabes as medidas da string em pixels... depois é só fazer as contas Dim textSize As Size = TextRenderer.MeasureText(tua_string, tua_fonte) MsgBox(textSize.Width) Link to comment Share on other sites More sharing options...
ribeiro55 Posted April 3, 2014 Report Share Posted April 3, 2014 O texto de um botão está por defeito centrado... Não sei ao que te referes. De qualquer forma, para colocar no topo (ou em qualquer outra posição), tens o TextAlign. Button1.TextAlign = ContentAlignment.TopCenter Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now