Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Programming > Server-Side Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2008, 09:58 AM
Junior Member
 
Join Date: Dec 2007
Posts: 24
Default how do i change the size of my button

hello,

can anybody advise me on how i can change the size of my button, i want it to be a specific size, i.e. smaller than what it is now. the following is the code i have. any suggestions will be good,
thanks

<
headid="Head1"runat="server">
<title>Untitled Page</title>
<scriptrunat="server">
Sub
submit(Source AsObject, e As EventArgs)
button1.Style(
"background-color") = "#ADD8E6"
button1.Style("color") = "#000000"
button1.Style("width")="200px"
button1.Style("cursor")="hand"
button1.Style("font-family")="verdana"
button1.Style("font-size") = "10pt"
button1.Text = "button"
EndSub
</
script>
</
head>
<
body>
<
formid="Form2"runat="server">
<
asp:Buttonid="button1"Text="Click me!"runat="server"OnClick="submit"/>
</
form>
</
body>
</
html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-30-2008, 11:49 PM
ryanhellyer's Avatar
Super Moderator
 
Join Date: Dec 2007
Posts: 708
Default

I don't know anything about ASP unfortunately.

But it looks like you are generating the styling of the button via server side scripting which I don't think should be necessary. This is usually handled by HTML/CSS which is outputted by your script, not by the script itself necessarily (other than outputting the styling). Form buttons can be styled the same way as any other block element, so if you want to make it an image, you would just use background:url('bla.png') in your CSS to over-ride the default button styling. If you don't specify a background image or colour, the default 3D look the browser applies to the button will remain, but you can alter the text styling without losing the default 3D button look.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-02-2008, 11:01 AM
Junior Member
 
Join Date: Dec 2007
Posts: 24
Default

thanks for your help, its always good to get someone elses opinion
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:29 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.