Board index » delphi » insert mode

insert mode

Hi everyone!

i am having the following problem: i need to know whem a user, that is browsing a database (using the control that alows to edit, insert, refresh, etc) chose to change the contents of the database (that is, chose the edit mode), so that i can change the look of some off the coontrols that are in the form. Is this possible?

Many thanks!

P.S: sorry for the bad English

 

Re:insert mode


The dataset has an OnStateChange event. That should do it for you!
--
Tox

Mario Amaral <mj...@junitec.ist.utl.pt> wrote in article
<55l0n0$...@ci.ist.utl.pt>...

Quote
> Hi everyone!

> i am having the following problem: i need to know whem a user, that is

browsing a database (using the control that alows to edit, insert, refresh,
etc) chose to change the contents of the database (that is, chose the edit
mode), so that i can change the look of some off the coontrols that are in
the form. Is this possible?
Quote

> Many thanks!

> P.S: sorry for the bad English

Re:insert mode


In article <55l0n0$...@ci.ist.utl.pt>,

Quote
mj...@junitec.ist.utl.pt (Mario Amaral) wrote:
>i am having the following problem: i need to know whem a user, that is
>browsing a database (using the control that alows to edit, insert,
>refresh, etc) chose to change the contents of the database (that is, chose
>the edit mode), so that i can change the look of some off the coontrols
>that are in the form. Is this possible?

Yes, it is possible. You have to do the check in the OnDataChange event for
the TDataSource that connects the table and the other components. The check
looks like this:

if (Table1.State  in [dsEdit,dsInsert]) then
  { Do your stuff }

The reason I check for both Edit and Insert is of course that the user can
edit the data in both cases.

--
CUL8R dude!                       \|/
                                  @ @
Jens  +-----------------------oOO-(_)-OOo-----------------------+
      | Internet   jb...@image.dk     CompuServe    100437,2475 |
      | FidoNet         2:235/142     VirNet          9:451/238 |
      | OS2Net          81:445/49     Fax     +45 - 3537 - 7006 |
      +---------------------------------------------------------+

Re:insert mode


Quote
Mario Amaral wrote:
> i am having the following problem: i need to know whem a user, that is browsing a database (using the control that alows to edit, insert, refresh, etc) chose to change the contents of the database (that is, chose the edit mode), so that i can change the look of some off the coontrols that are in the form. Is this possible?

I think that MASTAPP-demo in Delphi package contains just
that kind of Database Mode indicator on Order Form.

Even more easier is to download a DBModeIndicator component
from Delphi Super page. This comes with full source also.

Other Threads