Hi
I put incos in toolbar, but when Click in button the image disappears, please see figures attached
Why Icons disappears ?:eek:
Printable View
Hi
I put incos in toolbar, but when Click in button the image disappears, please see figures attached
Why Icons disappears ?:eek:
What control are you using for the buttons?
Toolbar and Imagelist
Does the toolbar "button" have clicked/not clicked or pressed/not pressed images? I don't know the exact terms but I've seen them.
thank you
But I do same code for others buttons and They work fine , only two buttons no work
Code:tbRelatorio.Buttons("TABELADINAMICA").Value = tbrUnpressed
tbRelatorio.Buttons("CRONOGRAMA").Value = tbrUnpressed
tbRelatorio.Buttons("GRUPOSEITENS").Value = tbrUnpressed
tbRelatorio.Buttons("CONVIDADOS").Value = tbrUnpressed
I believe is because the images that I put in Imagelist, in toobar I change index for other figure that work fine and too wotk fine
How can I to know if a figure will work fine ?
Tia
buttons change size when pressed so maybe your image could be a little smaller or you button could be a little bigger to make it work when pressed. This is true even with just text on a command button.
Ok
But What bmp or icons work fine when I click in toolbar, How can I to know ?
try different sizes and see what fits the buttons.
if your icons are dynamic (change often) then you can check to see if they will owrk or
you can always resize or clip icons a little to fit better.
I think the Toolbar has an image list for when the button is pressed and not pressed, and I think you have set the Imagelist only for the not pressed.
Why ohters buttons have only one image and work fine ?
OK, then I think you need to post your code so we can check where the problem is...
See below
tia
Code:Private Sub tbRelatorio_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "CRONOGRAMA"
fraFiltrosA = "FILTROS PARA GERAÇÃO DO CRONOGRAMA"
fraFiltrosA.ForeColor = &H80FF&
fraFiltrosA.Enabled = True
fraFiltrosB.Enabled = True
tbRelatorio.Buttons("TABELADINAMICA").Value = tbrUnpressed
tbRelatorio.Buttons("GRUPOSEITENS").Value = tbrUnpressed
tbRelatorio.Buttons("CONVIDADOS").Value = tbrUnpressed
tbRelatorio.Buttons("ESTOQUEUSO").Value = tbrUnpressed
tbRelatorio.Buttons("GERAR").Enabled = True
dtpDe.Visible = False
dtpDe.UpDown = True
' dtpDe.Month = Month(Now())
dtpDe.Value = Format(Now(), "mm/yyyy")
dtpDe.Format = dtpCustom
dtpDe.CustomFormat = "MM/yyyy"
dtpDe.Visible = True
habilita_frame_convaidados False
' lbxAnoInicio.Enabled = False
Case "TABELADINAMICA"
fraFiltrosA = "FILTROS PARA GERAÇÃO DA TABELA DINAMICA"
fraFiltrosA.ForeColor = &HC0C000
fraFiltrosA.Enabled = True
fraFiltrosB.Enabled = True
tbRelatorio.Buttons("CRONOGRAMA").Value = tbrUnpressed
tbRelatorio.Buttons("GRUPOSEITENS").Value = tbrUnpressed
tbRelatorio.Buttons("CONVIDADOS").Value = tbrUnpressed
tbRelatorio.Buttons("ESTOQUEUSO").Value = tbrUnpressed
tbRelatorio.Buttons("GERAR").Enabled = True
dtpDe.Value = Format(Now(), "dd/mm/yyyy")
dtpDe.CustomFormat = "dd/MM/yyyy"
dtpDe.UpDown = False
lbxAnoInicio.Enabled = True
habilita_frame_convaidados False
Case "GRUPOSEITENS"
fraFiltrosA = "FILTROS PARA GERAÇÃO DO RELATÓRIO DE GRUPOS E ITENS"
fraFiltrosA.ForeColor = &HC000&
fraFiltrosA.Enabled = True
fraFiltrosB.Enabled = True
tbRelatorio.Buttons("TABELADINAMICA").Value = tbrUnpressed
tbRelatorio.Buttons("CRONOGRAMA").Value = tbrUnpressed
tbRelatorio.Buttons("CONVIDADOS").Value = tbrUnpressed
tbRelatorio.Buttons("ESTOQUEUSO").Value = tbrUnpressed
tbRelatorio.Buttons("GERAR").Enabled = True
dtpDe.Value = Format(Now(), "dd/mm/yyyy")
dtpDe.CustomFormat = "dd/MM/yyyy"
dtpDe.UpDown = False
lbxAnoInicio.Enabled = True
habilita_frame_convaidados False
Case "CONVIDADOS"
fraFiltrosA = "FILTROS PARA GERAÇÃO DE CONVIDADOS"
fraFiltrosA.ForeColor = &HC000&
fraFiltrosA.Enabled = True
fraFiltrosB.Enabled = True
tbRelatorio.Buttons("TABELADINAMICA").Value = tbrUnpressed
tbRelatorio.Buttons("CRONOGRAMA").Value = tbrUnpressed
tbRelatorio.Buttons("GRUPOSEITENS").Value = tbrUnpressed
tbRelatorio.Buttons("ESTOQUEUSO").Value = tbrUnpressed
tbRelatorio.Buttons("GERAR").Enabled = True
dtpDe.Value = Format(Now(), "dd/mm/yyyy")
dtpDe.CustomFormat = "dd/MM/yyyy"
dtpDe.UpDown = False
lbxAnoInicio.Enabled = True
habilita_frame_convaidados True
Case "ESTOQUEUSO"
fraFiltrosA = "FILTROS PARA GERAÇÃO DE ESTOQUE X USO"
fraFiltrosA.ForeColor = &HC000&
fraFiltrosA.Enabled = True
fraFiltrosB.Enabled = True
tbRelatorio.Buttons("TABELADINAMICA").Value = tbrUnpressed
tbRelatorio.Buttons("CRONOGRAMA").Value = tbrUnpressed
tbRelatorio.Buttons("GRUPOSEITENS").Value = tbrUnpressed
tbRelatorio.Buttons("CONVIDADOS").Value = tbrUnpressed
tbRelatorio.Buttons("GERAR").Enabled = True
dtpDe.Value = Format(Now(), "dd/mm/yyyy")
dtpDe.CustomFormat = "dd/MM/yyyy"
dtpDe.UpDown = False
lbxAnoInicio.Enabled = True
habilita_frame_convaidados False
Case "GERAR"
pcbAguarde.Visible = True
pcbAguarde.ZOrder (0)
If tbRelatorio.Buttons("CRONOGRAMA").Value = tbrPressed Then
GeraCronograma
End If
If tbRelatorio.Buttons("TABELADINAMICA").Value = tbrPressed Then
GeraTabelaDinamica
End If
If tbRelatorio.Buttons("GRUPOSEITENS").Value = tbrPressed Then
GeraGruposItens
End If
If tbRelatorio.Buttons("CONVIDADOS").Value = tbrPressed Then
GeraConvidados
End If
If tbRelatorio.Buttons("ESTOQUEUSO").Value = tbrPressed Then
GeraEstoqueUso
End If
pcbAguarde.Visible = False
Exit Sub
Case "LIMPAR"
LimpaFiltros
Case "SAIR"
Unload Me
Exit Sub
End Select
HabilitaShapes True
HabilitaListas True
End Sub