Toolbar

Post Reply
User avatar
Patricio Avalos Aguirre
Posts: 1028
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile
Contact:

Toolbar

Post by Patricio Avalos Aguirre »

Estimados

Hay alguna forma de eliminar un item del toolbar

saludos
Patricio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Patricio,

Añade este método a la Clase TToolBar:

Code: Select all

#define TB_DELETEBUTTON        1046

METHOD DelButton( nButton ) CLASS TToolBar

   SendMessage( ::hWnd, TB_DELETEBUTTON, nButton - 1, 0 )
   
return nil   
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Patricio Avalos Aguirre
Posts: 1028
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile
Contact:

Post by Patricio Avalos Aguirre »

Gracias antonio

Perfecto..

Saludos
Patricio
User avatar
Patricio Avalos Aguirre
Posts: 1028
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile
Contact:

Post by Patricio Avalos Aguirre »

De nuevo por aqui

Como puedo ocultar y mostrar un icono del toolbar, buscando en internet vi estos ejemplos pero no funcionan

alguien me puede orientar

Code: Select all

#define TB_HIDEBUTTON          1028

METHOD HideButton( nButton ) INLINE SendMessage(::hwnd,   TB_HIDEBUTTON, nButton-1, 1 )

METHOD ShowButton( nButton ) INLINE SendMessage(::hwnd, TB_HIDEBUTTON, nButton-1, 0 )
Saludos
Patricio
User avatar
Patricio Avalos Aguirre
Posts: 1028
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile
Contact:

Post by Patricio Avalos Aguirre »

Estimados

Viendo estos metodos llegue a la conclusion que si funcionan, lo raro es que hay que ir a la inversa y diferencia del delbuton que el boton no se resta -1

Code: Select all

#define TB_DELETEBUTTON        1046
#define TB_HIDEBUTTON           1028

METHOD HideButton( nButton ) INLINE SendMessage(::hwnd, TB_HIDEBUTTON, nButton, 1 )

METHOD ShowButton( nButton ) INLINE SendMessage(::hwnd, TB_HIDEBUTTON, nButton, 0 )

METHOD DelButton(  nButton ) INLINE SendMessage( ::hWnd, TB_DELETEBUTTON, nButton - 1, 0 )

for i := len( aBnt ) to 1 STEP -1

  aBtn[i]:HideButton( i )

next i

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Patricio,

Gracias! :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Patricio Avalos Aguirre
Posts: 1028
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile
Contact:

Post by Patricio Avalos Aguirre »

Aqui hay otra y funciona bien

Code: Select all

#define TB_ISBUTTONHIDDEN      1036


METHOD IsButtonHidden( nButton ) INLINE (SendMessage( ::hWnd, TB_ISBUTTONHIDDEN, nButton, 0 ) <> 0 )


Saludos
Patricio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Patricio,

Muchas gracias :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply