[Newbie] DDX or DDV - Programmer

This is a discussion on [Newbie] DDX or DDV - Programmer ; Hi All, I have a dialog box with two columns (a,b) of edit controls. Above each column is a check box that can be used to make that column of controls the master for the other - so if the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [Newbie] DDX or DDV

  1. [Newbie] DDX or DDV

    Hi All,

    I have a dialog box with two columns (a,b) of edit controls. Above
    each column is a check box that can be used to make that column of
    controls the master for the other - so if the column a checkbox is
    set, then all the column b edit controls should be read-only and
    reflect the values entered in their column a counterparts. Well thats
    what I would *like* to happen...

    I am unsure if I should be using a DDX (CEdit) or DDV (CInt) variable
    for each edit control. If I use CEdit, then I have access to the very
    handy ReadOnly(TRUE) method which I can use to disable edit controls,
    but I am not sure how to ensure the user only enters a certain range
    of integer values, or indeed how to get the value out of the CEdit
    variable.

    If on the other hand I use CInt, then I can use DDV_MinMaxInt() to
    check what the user enters, but I am then not sure how to make
    controls read-only etc.

    Can someone please give me a hint as to what to do here? I am sure
    that this is very very common, but I must admit I am stumped.

  2. Re: [Newbie] DDX or DDV

    In article <94387a7d.0407151928.64fa580e@posting.google.com>,
    rodney.elliott@canterbury.ac.nz (Rodney B. Elliott) wrote:

    > I have a dialog box with two columns (a,b) of edit controls. Above
    > each column is a check box that can be used to make that column of
    > controls the master for the other - so if the column a checkbox is
    > set, then all the column b edit controls should be read-only and
    > reflect the values entered in their column a counterparts. Well thats
    > what I would *like* to happen...
    >
    > I am unsure if I should be using a DDX (CEdit) or DDV (CInt) variable
    > for each edit control. If I use CEdit, then I have access to the very
    > handy ReadOnly(TRUE) method which I can use to disable edit controls,
    > but I am not sure how to ensure the user only enters a certain range
    > of integer values, or indeed how to get the value out of the CEdit
    > variable.
    >
    > If on the other hand I use CInt, then I can use DDV_MinMaxInt() to
    > check what the user enters, but I am then not sure how to make
    > controls read-only etc.
    >
    > Can someone please give me a hint as to what to do here? I am sure
    > that this is very very common, but I must admit I am stumped.


    You can do both: you can bind a control to two different variables.

  3. Re: [Newbie] DDX or DDV

    You are right - I was just attempting to use them incorrectly.
    UpdateData() is a wonderful thing...

+ Reply to Thread