static extern int EnumChildWindows(IntPtr hwnd, EnumChildWindowsCallBack x, IntPtr y);
private void SaveBookmarkForm_Load(object sender, EventArgs e) { RestImpl ri = new RestImpl(); IDictionary <String, String> paramList = new Dictionary <String, String>(); //MessageBox.Show(strResponse); try { string target_url = "http://spheresolutions.org/feedmanager/admin/commoncause_xml.php"; HttpWebRequest webRequest = ri.CreateRequest(target_url, paramList); strResponse = ri.GetXMLResponse(webRequest); alertlist = strResponse.GetElementsByTagName("tag"); foreach (XmlElement element in alertlist) { tagid.Add(element.GetAttribute("id")); } //tagid.ToArray(); int i; int total_count = alertlist.Count; int LeftX = 86; int LeftY = 285; int RightX = 300; int RightY = 285; CheckBox ch = null; CheckBox lastCheckBox = null; for (i = 0; i < total_count; i++) { if (i == 0) { ch = checkbox1; ch.Text = alertlist.Item(i).InnerText; } else if (i == 1) { ch = checkbox2; ch.Text = alertlist.Item(i).InnerText; } else if (i == 2) { ch = checkbox3; ch.Text = alertlist.Item(i).InnerText; } else if (i == 3) { ch = checkbox4; ch.Text = alertlist.Item(i).InnerText; } else if (i == 4) { ch = checkbox5; ch.Text = alertlist.Item(i).InnerText; } else if (i == 5) { ch = checkbox6; ch.Text = alertlist.Item(i).InnerText; } else if (i == 6) { ch = checkbox7; ch.Text = alertlist.Item(i).InnerText; } else if (i == 7) { ch = checkbox8; ch.Text = alertlist.Item(i).InnerText; } else if (i == 8) { ch = checkbox9; ch.Text = alertlist.Item(i).InnerText; } else if (i == 9) { ch = checkbox10; ch.Text = alertlist.Item(i).InnerText; } else if (i == 10) { ch = checkbox11; ch.Text = alertlist.Item(i).InnerText; } else if (i == 11) { ch = checkbox12; ch.Text = alertlist.Item(i).InnerText; } else if (i == 12) { ch = checkbox13; ch.Text = alertlist.Item(i).InnerText; } else if (i == 13) { ch = checkbox14; ch.Text = alertlist.Item(i).InnerText; } else if (i == 14) { ch = checkbox15; ch.Text = alertlist.Item(i).InnerText; } else if (i == 15) { ch = checkbox16; ch.Text = alertlist.Item(i).InnerText; } else if (i == 16) { ch = checkbox17; ch.Text = alertlist.Item(i).InnerText; } else if (i == 17) { ch = checkbox18; ch.Text = alertlist.Item(i).InnerText; } else if (i == 18) { ch = checkbox19; ch.Text = alertlist.Item(i).InnerText; } else if (i == 19) { ch = checkbox20; ch.Text = alertlist.Item(i).InnerText; } if (i % 2 == 0) { //LeftY += (i + 1) * 30; if (i > 0) { LeftY += 20; } ch.Location = new System.Drawing.Point(LeftX, LeftY); } else { //RightY += (i + 1) * 30; if (i > 1) { RightY += 20; } ch.Location = new System.Drawing.Point(RightX, RightY); } this.Controls.Add(ch); lastCheckBox = ch; } this.BtnSave.Location = new Point(400, lastCheckBox.Location.Y + 100); this.BtnCancel.Location = new Point(500, lastCheckBox.Location.Y + 100); this.Controls.Add(BtnSave); this.Controls.Add(BtnCancel); /*load the state combo box here*/ target_url = "http://spheresolutions.org/feedmanager/admin/state_xml.php"; HttpWebRequest webRequest2 = ri.CreateRequest(target_url, paramList); strResponse = ri.GetXMLResponse(webRequest2); XmlNodeList stateList = strResponse.GetElementsByTagName("state_name"); this.comboBox1.Items.Add("National"); for (int j = 0; j < stateList.Count; j++) { this.comboBox1.Items.Add(stateList.Item(j).InnerText); } m_readOnly = true; EnumChildWindowsCallBack callBack = new EnumChildWindowsCallBack(this.EnumChildWindowsCallBackFunction); EnumChildWindows(comboBox1.Handle, callBack, IntPtr.Zero); } catch (Exception ex) { //MessageBox.Show(ex.ToString()); } }
internal static extern int EnumChildWindows(IntPtr hWndParent, EnumChildWindowsCallBack lpEnumFunc, IntPtr lParam);
public static extern bool EnumChildWindows(int hWndParent, EnumChildWindowsCallBack lpEnumFunc, int lParam);