Editor pairs Posted June 1, 2012 Editor Share Posted June 1, 2012 S.a arkadaşlar C# da treedeki seçili olan checkbox ları kontrol ettirmek istiyorum ama beceremedim anlayan arkadaşlar yardımcı olabilirlermi. Quote Link to comment Share on other sites More sharing options...
artal73 Posted June 1, 2012 Share Posted June 1, 2012 [font="Verdana"]"Checked" özelliğinin True mu False mu olduğunu kontrol etmeniz gerekiyor[/font] if (checkBox1.Checked == true) MessageBox.Show("Seçili"); else MessageBox.Show("Seçili değil"); Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted June 1, 2012 Author Editor Share Posted June 1, 2012 Benim demek istediğim normal checkbox değil tree nesnesindeki checkbox. Quote Link to comment Share on other sites More sharing options...
MostWanted Posted June 1, 2012 Share Posted June 1, 2012 Bu konu "Sohbet-Chat" forumundan "Yazılım" forumuna taşınmıştır. Quote Link to comment Share on other sites More sharing options...
cumman Posted June 1, 2012 Share Posted June 1, 2012 Bu kodu codebehinde yapistir. treeView1 isminde ekle formuna. Checkboxlari enable yap. daha sonra aftercheck eventini treevView1_AfterCheck olarak sec.Daha sonra breakpointler koyarak debug et. Program acilinca bir tanesini check et ve debug yontemiyle izle sonuclari. [codebox] bool busy = false; private void treeView1_AfterCheck(object sender, TreeViewEventArgs e) { if (busy) return; busy = true; try { checkNodes(e.Node, e.Node.Checked); } finally { busy = false; } } private void checkNodes(TreeNode node, bool check) { foreach (TreeNode child in node.Nodes) { child.Checked = check; checkNodes(child, check); } } [/codebox] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.