Bài 2: Viết code tạo giao diện
Class1lop = newClass1();
privatevoidForm5_Load(objectsender, EventArgse)
{
SqlDataReaderrd = lop.Reader("select * from Menucap1");
while(rd.Read()) //for (int j = 0; j < 4; j++)
{
DevComponents.DotNetBar.RibbonTabItemDung = newDevComponents.DotNetBar.RibbonTabItem();
DevComponents.DotNetBar.RibbonPanelPaner = newDevComponents.DotNetBar.RibbonPanel();
Dung.Text = rd.GetString(1); ;
Dung.Name = rd.GetString(0) ;
Dung.Panel = Paner;
ribbonControl1.Items.Add(Dung);
Paner.Dock = System.Windows.Forms.DockStyle.Fill;
Paner.Location = newSystem.Drawing.Point(0, 53);
Paner.Name = rd.GetString(0);
Paner.Padding = newSystem.Windows.Forms.Padding(3, 0, 3, 3);
Paner.Size = newSystem.Drawing.Size(901, 99);
Paner.TabIndex = 2;
ribbonControl1.Controls.Add(Paner);
DevComponents.DotNetBar.RibbonBarThungchua = newDevComponents.DotNetBar.RibbonBar();
SqlDataReaderrd1 = lop.Reader(string.Format("select Menucap2.Macap2,Tencap2,trangthai from Menucap2,Phanquyencap2 where Macap1='{0}' and Mauser='Us02' and Menucap2.Macap2=Phanquyencap2.Macap2", rd.GetString(0)));
// SqlDataReader rd1 = lop.Reader(string.Format("select * from Menucap2 where Macap1='{0}'", rd.GetString(0)));
while(rd1.Read())
//for (int i = 0; i < 4; i++)
{
DevComponents.DotNetBar.ButtonItemLenh = newDevComponents.DotNetBar.ButtonItem();
Lenh.Name = rd1.GetString(0) ;
Lenh.Text = rd1.GetString(1) ;
// Lenh.Icon = ((System.Drawing.Icon)(resources.GetObject("buttonItem16.Icon")));
Lenh.Enabled = Convert.ToBoolean(rd1.GetValue(2));
Thungchua.Items.Add(Lenh);
}
Paner.Controls.Add(Thungchua);
}
}
» Tin mới nhất:
» Các tin khác: