Pra que serve realmente a propriedade Tag?
pessoal vamos debater pra que realmente é usado a propriedade tag em nosso benefício...
Bruno Belchior
Curtidas 0
Respostas
Mkoch
09/03/2005
Resumindo, ela serve como uma Flag auxiliar onde é possível armazenar qualquer coisa com até 4 bytes, um ponteiro para um objeto, um número Inteiro etc.
ex.: if MeuBotao.Tag = 100 then Exit else Form2.Show;
ex.: if MeuBotao.Tag = 100 then Exit else Form2.Show;
GOSTEI 0
Silviogs
09/03/2005
Olá amigo,
também server para isso.
CarregaBitmap(ImageTreeview, ´IMG_COMPUTADOR´ , clRed);
CarregaBitmap(ImageTreeview, ´IMG_FERRAMENTAS2´ , clSilver);
CarregaBitmap(ImageTreeview, ´IMG_LIXEIRA´ , clSilver);
CarregaBitmap(ImageTreeview, ´IMG_APERTO_MAO´ , clPurple);
CarregaBitmap(ImageTreeview, ´IMG_COMPUTADOR´ , clRed);
Monta BitMap Menu Cadastros
for i := 9 to 17 do begin
TMenuItem(FindComponent(´Menu´+InttoStr(i)).Tag := i;
TMenuItem(FindComponent(´Menu´+InttoStr(i))).ImageIndex := TMenuItem(FindComponent(´Menu´+InttoStr(i))).Tag;
end;
e mais:
Case BtnRotinas.Tag of
// Distribuição
0 : begin
if MessagedlgDef(´Confirma distriuição do Processo S/N´,mtconfirmacao,[mbSim,mbNao], mrSim,0,´Distribuir Processo´,´´) = mrSim then begin
end;
end;
// Devolução
1 : if MessagedlgDef(´Confirma a devolução do Processo S/N´,mtconfirmacao,[mbSim,mbNao], mrSim,0,´Distribuir Processo´,´´) = mrSim then begin
end;
end;
Ateciosamente,
Silvio Guedes
também server para isso.
CarregaBitmap(ImageTreeview, ´IMG_COMPUTADOR´ , clRed);
CarregaBitmap(ImageTreeview, ´IMG_FERRAMENTAS2´ , clSilver);
CarregaBitmap(ImageTreeview, ´IMG_LIXEIRA´ , clSilver);
CarregaBitmap(ImageTreeview, ´IMG_APERTO_MAO´ , clPurple);
CarregaBitmap(ImageTreeview, ´IMG_COMPUTADOR´ , clRed);
Monta BitMap Menu Cadastros
for i := 9 to 17 do begin
TMenuItem(FindComponent(´Menu´+InttoStr(i)).Tag := i;
TMenuItem(FindComponent(´Menu´+InttoStr(i))).ImageIndex := TMenuItem(FindComponent(´Menu´+InttoStr(i))).Tag;
end;
e mais:
Case BtnRotinas.Tag of
// Distribuição
0 : begin
if MessagedlgDef(´Confirma distriuição do Processo S/N´,mtconfirmacao,[mbSim,mbNao], mrSim,0,´Distribuir Processo´,´´) = mrSim then begin
end;
end;
// Devolução
1 : if MessagedlgDef(´Confirma a devolução do Processo S/N´,mtconfirmacao,[mbSim,mbNao], mrSim,0,´Distribuir Processo´,´´) = mrSim then begin
end;
end;
Ateciosamente,
Silvio Guedes
GOSTEI 0
Bruno Belchior
09/03/2005
certo porém como eu acrecentaria por exemplo um campo TField?
GOSTEI 0