SetTBbuttonWidth

Syntax:

SetTBbuttonWidth( #ButtonID, Width )

Parameters:

#ButtonID

=

your ButtonID

Width

=

new Width for the Button


Description:

Set a new Width for a TB-Button


Example:

  ;
  ; complete example (cut&paste to run)
  ;
  hWnd = OpenWindow(0,10,10,200,100,#WS_POPUP,"")
  CreateTB(0,hWnd,0,0)
  
  For a = 1 To 20
    AddTBtextButton(a,"Button "+Str(a),#TBpro_BUTTON): AddTBbreak()
  Next a
  AddTBtextButton(21,"Quit",#TBpro_BUTTON)

  For a = 1 To 21
    SetTBbuttonWidth(a, 200)
  Next a

  ResizeWindow(TBwidth(),TBheight())

  Repeat
    If WaitWindowEvent() = #PB_EventMenu And EventMenuID() = 21
      End
    EndIf
  ForEver

Remarks:

Attention:

The commands AddTBtextButton() and SetTBbuttonText() reset the

ButtonWidth for all Buttons to its original state !!

Use SetTBbuttonWidth() only after adding all TextButtons and after

setting the Text for the Buttons.


Dont use SetTBbuttonWidth() with SetTBbuttonText() and AddTBtextButton() in the same loop !!



Supported OS:   Windows