NetTalk Central

Author Topic: Changing width of a button  (Read 4980 times)

Bram Klootwijk

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Changing width of a button
« on: July 04, 2007, 08:34:02 AM »
Hi All,

how can i change the width of a button? There are properties for the text like p_web.site.SaveButton.TextValue, but i want to make a button widther to fit the text.....


Any help?

Greetings,
Bram

Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: Changing width of a button
« Reply #1 on: July 04, 2007, 01:06:53 PM »
Bram,

I haven't done this myself, but I've seen others do it.
Go to your WebServer procedure, choose extensions, select "Net Talk ..." object, Settings, Buttons.

Here is the list of predefined buttons and styles.
Under properties each button has a "Button Class". Most of the buttons are set by default to use 'MainButton' or 'SmallButton'.

This refers to styles in your WEB\STYLES\* folder.
Find the style here e.g.
.MainButton {
  width: 80px;
  height: 26px;
  margin: 3px 1px;
  font-family: Tahoma, Verdana,  Arial, Helvetica, sans-serif;
  font-size: 11px;
  cursor: pointer;
  padding: 0px;
}

and then alter the width/height.
Note - I suggest you create a new button class.
LargeButton, XLButton, XXLbutton, with each class having different width/height.

There may be other ways as well.
Regards,
Alan

Bram Klootwijk

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Re: Changing width of a button
« Reply #2 on: July 04, 2007, 01:24:02 PM »
Hi Alan,

thanx for the fast support! I hoped there was an easy way to change them at run-time, but i'll try it this way....

Cheers,
Bram

Bram Klootwijk

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Re: Changing width of a button
« Reply #3 on: July 05, 2007, 05:07:59 AM »
Hi Alan,

tried to change the buttonclass on a webform to 'Smallbutton' (i want that class for the save and cancel-buttons for 1 form, not for all), but the generated form /html still reflects to 'Mainbutton' when viewing the source-code in the IE browser. Are the classes not 'overridden' in the Netwebform settings (tab CSS Classes)?

Greetings,
Bram

Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: Changing width of a button
« Reply #4 on: July 05, 2007, 01:46:25 PM »
If adding a button onto a form:
  set Type = 'Display'
Then on settings tab:
 
  • Button = checked

  Type = 'Button'
  Name = 'somename_btn'
  Text = 'what you want to display on button'
  CSS Class = 'SmallButton'    <----- This works here

On a BROWSE, when adding fields, if you select
   TYPE=BUTTON, then choose
   Action = 'Other'
and you will get the same options for CSS Class.

Alan

Bram Klootwijk

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Re: Changing width of a button
« Reply #5 on: July 06, 2007, 12:37:48 AM »
Hi Alan,

yes, you're right. But the class does not work for the genreated "Save" , "Cancel" buttons. I misused these buttons to do some work after adding a record. I used your advice to place the buttons in the form and added code to the embed "Add Server Side Code Here".

Greetings,
Bram