I have 2 radio button say r1 and r2.grouped together and made r1 group as true from property. I have made bool variable(vr) and attached with these radio button(DDX).
Now from code i wrote vr =1 then updatedata(TRUE). but from ui it is still showing r1 radio button active, inste开发者_如何学编程ad of r2. how to make radio r2 active by changing vr?
UpdateData(TRUE)
is to update the variables with the controls data. You want to update the controls from the variables, so you must use UpdateData(FALSE)
.
Note: I always add the following defines to stdafx.h so I won't forget:
// to use with UpdateData
#define TOWINDOW FALSE
#define TODATA TRUE
and then I just use UpdateData(TOWINDOW)
or UpdateData(TODATA)
.
精彩评论