Jump to content
Fórum Script Brasil
  • 0

[resolvido] Dbnavigator


Eder
 Share

Question

Ola..pessoal

eu gostaria de saber como faço um if tipo este abaixo...

Mas este abaixo não funciona ta errado..

IF FORM5.USUARIO.CAPTION = 'CARLOS' THEN
BEGIN
DBNavigator1.VisibleButtons.nbdelete:=True
else
DBNavigator1.VisibleButtons.nbdelete:=false
end;

O que eu queria é só deixar o visible=true do botão NbDeleti pro Carlos o restante FALSE

mas eu queria no codigo....

ta pra fazer??

muito grato

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Guest --Jonas --

A forma correta seria:

IF FORM5.USUARIO.CAPTION = 'CARLOS' THEN
BEGIN
DBNavigator1.VisibleButtons := [nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh];
else
DBNavigator1.VisibleButtons := [nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbEdit, nbPost, nbCancel, nbRefresh];
end;

Link to comment
Share on other sites

  • 0

Outra forma, utilizando operação com conjuntos (que é do que se trata VisibleButtons):

IF FORM5.USUARIO.CAPTION = 'CARLOS' THEN
  DBNavigator1.VisibleButtons := DBNavigator1.VisibleButtons + [nbDelete]  // inclui delete no conjunto
else
  DBNavigator1.VisibleButtons := DBNavigator1.VisibleButtons - [nbDelete];  // remove delete do conjunto

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...