c++ - Need to call twice a setter to force GUI refresh in MFC -


i'm using mfc combobox control change parameter has constituencies on ip range available ( only/ no broadcast ip example).

i need call range modification function twice force refreshing on showed values : why ?

behaviour :

enter image description here

                         1 call range modification 

 2 call range modification

                         2 calls range modification 

source code :

void cipaddressbugdlg::onchangecombo() {      updatedata(true);     changeiprange();     //changeiprange();  }   void cipaddressbugdlg::changeiprange() {     byte nfield0, nfield1, nfield2, nfield3;      if ( combo.getcursel() )     {         ipaddress.getaddress(nfield0, nfield1, nfield2, nfield3);         if ( nfield0  < (byte) 224 )             nfield0 = 224;         ipaddress.setaddress(nfield0, nfield1, nfield2, nfield3);         ipaddress.setfieldrange(0, 224 , 232 );     }     else     {         ipaddress.getaddress(nfield0, nfield1, nfield2, nfield3);         if ( nfield0  >= (byte) 224 )             nfield0 = 223;         ipaddress.setaddress(nfield0, nfield1, nfield2, nfield3);         ipaddress.setfieldrange(0, 0 , 223 );     } } 

combo combobox control , ipaddress cipaddressctrl. i'm compiling on vs c++ 6.0 (yes know -_- ) running windows xp.

( can upload whole toy project if necessary )

try moving setfieldrange before setaddress else windows ignore setaddress because it's out of range.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -