c# - how can i set location of buttons in winphone 8 -


when change button's visibility collapsed, other buttons' locations change too. want buttons stay in original locations. (btn.location produced error & did not work)

this code :

for (int k = 0; k < 4; k++) {   (int j = 0; j < 4; j++)   {     button btn = new button();     {       btn.name = "btn" + i.tostring();       btn.height = 100;       btn.width = 100;       btn.content = "0";       btn.margin = new thickness(y, x, 0, 0);       btn.visibility = visibility.visible;     }     btns[i] = btn;     stkpanel.children.add(btn);     i++;   }   x -= 700;   y += 200; } contentpanel.children.add(stkpanel); 

as trick instead of setting visibility collapsed, set buttons opacity 0 , isenabled false.

btn.opacity = 0; btn.isenabled = false; 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -