資源簡介
左側導航菜單,是根據nzwangjian做的菜單的基礎上做了部分的修改,給大家做個參考,可以在此基礎上讀取數據庫的數據,來動態生成導航菜單。
寫的比較粗超,還請見諒哈~~
寫的比較粗超,還請見諒哈~~
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?HandWrite
{
????public?partial?class?Mainfrm?:?Form
????{
????????public?Mainfrm()
????????{
????????????InitializeComponent();
????????}
????????public?System.Windows.Forms.Panel?ActivePanel?=?new?Panel();
????????private?int?recordButton;
????????private?void?AddButton()
????????{
????????????Button[]?mybutton?=?new?Button[4];
????????????for?(int?i?=?0;?i?<=?3;?i++)
????????????{
????????????????mybutton[i]?=?new?Button();
????????????????if?(i?==?0)
????????????????{
????????????????????mybutton[i].Dock?=?System.Windows.Forms.Dockstyle.Top;
????????????????????mybutton[i].Location?=?new?System.Drawing.Point(0?0);
????????????????}
????????????????else
????????????????{
????????????????????mybutton[i].Dock?=?Dockstyle.Bottom;
????????????????????mybutton[i].Location?=?new?System.Drawing.Point(0?361?+?32?*?(i?-?1));
????????????????}
????????????????mybutton[i].Size?=?new?System.Drawing.Size(136?32);
????????????????mybutton[i].Text?=?i.ToString();
????????????????mybutton[i].Name?=?i.ToString();
????????????????mybutton[i].UseVisualstyleBackColor?=?true;
????????????????mybutton[i].Click?+=?new?EventHandler(Buttonclick);
????????????????splitContainer1.Panel1.Controls.Add(mybutton[i]);
????????????}
????????}
????????private?void?AddPanel()
????????{
????????????Panel[]?mypanel?=?new?Panel[4];
????????????Button[]?btn?=?new?Button[10];
????????????Label[]?lab?=?new?Label[10];
????????????for?(int?i?=?0;?i?<=?3;?i++)
????????????{
????????????????mypanel[i]?=?new?Panel();
????????????????mypanel[i].AutoScroll?=?true;
????????????????mypanel[i].Location?=?new?System.Drawing.Point(3?59);
????????????????mypanel[i].Size?=?new?System.Drawing.Size(126?263);
????????????????mypanel[i].Name?=?i.ToString();
????????????????//mypanel[i].BackColor?=?Color.Blue;
????????????????if?(i?==?0)
????????????????{
????????????????????mypanel[i].Dock?=?Dockstyle.Fill;
????????????????}
????????????????for?(int?j?=?0;?j?<=?4;?j++)
????????????????{
????????????????????btn[j]?=?new?Button();
????????????????????btn[j].Text?=?i.ToString()?+?“***“?+?j.ToString();
????????????????????btn[j].Name?=?j.ToString();
????????????????????btn[j].Location?=?new?System.Drawing.Point(50?33?+?83?*?j);
????????????????????btn[j].Size?=?new?System.Drawing.Size(48?41);
????????????????????btn[j].UseVisualstyleBackColor?=?true;
????????????????????mypanel[i].Controls.Add(btn[j]);
????????????????}
????????????????for?(int?x?=?0;?x?<=?4;?x++)
????????????????{
????????????????????lab[x]?=?new?Label();
????????????????????lab[x].Name?=?x.ToString();
????????????????????lab[x].Text?=?x.ToString();
????????????????????lab[x].Location?=?new?System.Drawing.Point(65?77?+?84?*?x);
????????????????????lab[x].Si
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????869??2011-06-22?13:58??HandWrite\HandWrite.sln
????..A..H.?????31744??2011-09-19?14:07??HandWrite\HandWrite.suo
?????文件???????3687??2011-09-19?13:57??HandWrite\HandWrite\HandWrite.csproj
?????文件????????492??2011-09-14?09:35??HandWrite\HandWrite\Program.cs
?????文件???????5598??2011-09-19?14:07??HandWrite\HandWrite\Mainfrm.cs
?????文件???????5977??2011-09-19?14:00??HandWrite\HandWrite\Mainfrm.Designer.cs
?????文件???????7506??2011-09-19?14:00??HandWrite\HandWrite\Mainfrm.resx
?????文件???????1382??2011-06-22?13:57??HandWrite\HandWrite\Properties\AssemblyInfo.cs
?????文件???????2868??2011-06-22?13:57??HandWrite\HandWrite\Properties\Resources.Designer.cs
?????文件???????5612??2011-06-22?13:57??HandWrite\HandWrite\Properties\Resources.resx
?????文件???????1094??2011-06-22?13:57??HandWrite\HandWrite\Properties\Settings.Designer.cs
?????文件????????249??2011-06-22?13:57??HandWrite\HandWrite\Properties\Settings.settings
?????文件???????4440??2011-06-22?16:40??HandWrite\HandWrite\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6226??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????3618??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\GenerateResource.read.1.tlog
?????文件??????10566??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\GenerateResource.write.1.tlog
?????文件???????6658??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\HandWrite.csproj.FileListAbsolute.txt
?????文件??????13312??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\HandWrite.exe
?????文件????????180??2011-09-14?09:35??HandWrite\HandWrite\obj\x86\Debug\HandWrite.Form1.resources
?????文件????????180??2011-09-14?09:35??HandWrite\HandWrite\obj\x86\Debug\HandWrite.Login.resources
?????文件????????180??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\HandWrite.Properties.Resources.resources
?????文件???????7897??2011-06-22?16:51??HandWrite\HandWrite\obj\x86\Debug\ResolveAssemblyReference.cache
?????文件????????180??2011-07-06?13:08??HandWrite\HandWrite\obj\x86\Debug\HandWrite.Frm_log.resources
?????文件????????180??2011-09-14?09:35??HandWrite\HandWrite\obj\x86\Debug\HandWrite.Frm_set.resources
?????文件???????1158??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\HandWrite.Mainfrm.resources
?????文件??????87552??2011-09-19?14:07??HandWrite\HandWrite\obj\x86\Debug\HandWrite.pdb
?????文件????????809??2011-06-28?15:24??HandWrite\HandWrite\bin\Debug\book.txt
?????文件??????13312??2011-09-19?14:07??HandWrite\HandWrite\bin\Debug\HandWrite.exe
?????文件??????87552??2011-09-19?14:07??HandWrite\HandWrite\bin\Debug\HandWrite.pdb
?????文件??????11600??2011-09-19?14:07??HandWrite\HandWrite\bin\Debug\HandWrite.vshost.exe
............此處省略65個文件信息
- 上一篇:C#TCP 通信(TCP發送16進制)
- 下一篇:c#向word文件插入圖片
評論
共有 條評論