TextBox dentro de CommandBars

28/03/2005 - 00:41 por SG Web Design - Sergio Gattelet | Informe spam
Hola Grupo

Quisiera dentro de una barra de herramientas poder tener un textbox para
introducir texto por el usuario. Es esto posible?

Saludos,
Sergio

Preguntas similare

Leer las respuestas

#1 Fernando Arroyo
28/03/2005 - 09:17 | Informe spam
"SG Web Design - Sergio Gattelet" escribió en el mensaje news:
Hola Grupo

Quisiera dentro de una barra de herramientas poder tener un textbox para
introducir texto por el usuario. Es esto posible?

Saludos,
Sergio





Yo no lo he usado nunca, pero hay un tipo de control msoControlEdit el cual pienso que se comporta de forma parecida a un cuadro de texto.
Un saludo.


Fernando Arroyo
MS MVP - Excel
Respuesta Responder a este mensaje
#2 Fernando Arroyo
28/03/2005 - 09:52 | Informe spam
Con el siguiente código puedes ver un ejemplo:


Sub Prueba()
Dim cbMiBarra As Office.CommandBar
Dim ceMiControlEdit As Office.CommandBarComboBox

Set cbMiBarra = CommandBars.Add("MiBarra", msoBarPopup, False, True)
Set ceMiControlEdit = cbMiBarra.Controls.Add(msoControlEdit, , , , temporary:=True)

With ceMiControlEdit
.Caption = "MiControl"
.Text = "Texto por defecto" 'No es necesario
.Width = 250
End With

cbMiBarra.ShowPopup
MsgBox "Lo introducido en el cuadro de texto es: " & ceMiControlEdit.Text

CommandBars("MiBarra").Delete

Set ceMiControlEdit = Nothing
Set cbMiBarra = Nothing
End Sub


Un saludo.


Fernando Arroyo
MS MVP - Excel
Respuesta Responder a este mensaje
#3 SG Web Design - Sergio Gattelet
28/03/2005 - 14:02 | Informe spam
Gracias Fernando, lo probare y luego te respondo como andubo. Gracias por tu
tiempo!

Sergio

"Fernando Arroyo" escribió en el mensaje
news:
Con el siguiente código puedes ver un ejemplo:


Sub Prueba()
Dim cbMiBarra As Office.CommandBar
Dim ceMiControlEdit As Office.CommandBarComboBox

Set cbMiBarra = CommandBars.Add("MiBarra", msoBarPopup, False, True)
Set ceMiControlEdit = cbMiBarra.Controls.Add(msoControlEdit, , , ,
temporary:=True)

With ceMiControlEdit
.Caption = "MiControl"
.Text = "Texto por defecto" 'No es necesario
.Width = 250
End With

cbMiBarra.ShowPopup
MsgBox "Lo introducido en el cuadro de texto es: " &
ceMiControlEdit.Text

CommandBars("MiBarra").Delete

Set ceMiControlEdit = Nothing
Set cbMiBarra = Nothing
End Sub


Un saludo.


Fernando Arroyo
MS MVP - Excel
Respuesta Responder a este mensaje
#4 KL
28/03/2005 - 16:22 | Informe spam
Hola Sergio,

Mas info:
http://tinyurl.com/64t3d

Saludos,
KL

"SG Web Design - Sergio Gattelet" wrote in message
news:
Gracias Fernando, lo probare y luego te respondo como andubo. Gracias por
tu
tiempo!

Sergio

"Fernando Arroyo" escribió en el mensaje
news:
Con el siguiente código puedes ver un ejemplo:


Sub Prueba()
Dim cbMiBarra As Office.CommandBar
Dim ceMiControlEdit As Office.CommandBarComboBox

Set cbMiBarra = CommandBars.Add("MiBarra", msoBarPopup, False, True)
Set ceMiControlEdit = cbMiBarra.Controls.Add(msoControlEdit, , , ,
temporary:=True)

With ceMiControlEdit
.Caption = "MiControl"
.Text = "Texto por defecto" 'No es necesario
.Width = 250
End With

cbMiBarra.ShowPopup
MsgBox "Lo introducido en el cuadro de texto es: " &
ceMiControlEdit.Text

CommandBars("MiBarra").Delete

Set ceMiControlEdit = Nothing
Set cbMiBarra = Nothing
End Sub


Un saludo.


Fernando Arroyo
MS MVP - Excel


Respuesta Responder a este mensaje
#5 KL
28/03/2005 - 16:33 | Informe spam
Perdon, no me di cuenta de haber copiado objetos graficos junto con el
texto.

KL

"KL" wrote in message
news:
Hola de nuevo,

Esto lo he encontrado en la ayuda de Excel VBA (en mi caso en ingles).

Saludos,
KL

CommandBarComboBox Object







Represents a combo box control on a command bar.

Using the CommandBarComboBox Object

Use Controls(index), where index is the index number of the control, to
return a CommandBarComboBox object. (The Type property of the control must
be msoControlEdit, msoControlDropdown, msoControlComboBox,
msoControlButtonDropdown, msoControlSplitDropdown, msoControlOCXDropdown,
msoControlGraphicCombo, or msoControlGraphicDropdown.)

The following example adds two items to the second control on the command
bar named "Custom," and then it adjusts the size of the control.

Set combo = CommandBars("Custom").Controls(2)
With combo
.AddItem "First Item", 1
.AddItem "Second Item", 2
.DropDownLines = 3
.DropDownWidth = 75
.ListIndex = 0
End WithYou can also use the FindControl method to return a
CommandBarComboBox object. The following example searches all command bars
for a visible CommandBarComboBox object whose tag is "sheet assignments."

Set myControl = CommandBars.FindControl _
(Type:=msoControlComboBox, Tag:="sheet assignments", Visible:=True)


Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaSiguiente Respuesta Tengo una respuesta
Search Busqueda sugerida