Form_Main.cs
上传用户:chinapurv
上传日期:2014-03-12
资源大小:4870k
文件大小:10k
源码类别:

教育系统应用

开发平台:

C#

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. namespace 图书管理系统
  8. {
  9. /// <summary>
  10. /// Form1 的摘要说明。
  11. /// </summary>
  12. public class Form_Main : System.Windows.Forms.Form
  13. {
  14. private System.ComponentModel.IContainer components;
  15. public Form_Main()
  16. {
  17. //
  18. // Windows 窗体设计器支持所必需的
  19. //
  20. InitializeComponent();
  21. //
  22. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  23. //
  24. }
  25. /// <summary>
  26. /// 清理所有正在使用的资源。
  27. /// </summary>
  28. protected override void Dispose( bool disposing )
  29. {
  30. if( disposing )
  31. {
  32. if (components != null) 
  33. {
  34. components.Dispose();
  35. }
  36. }
  37. base.Dispose( disposing );
  38. }
  39. #region Windows 窗体设计器生成的代码
  40. /// <summary>
  41. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  42. /// 此方法的内容。
  43. /// </summary>
  44. private void InitializeComponent()
  45. {
  46. this.components = new System.ComponentModel.Container();
  47. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form_Main));
  48. this.butExit = new System.Windows.Forms.Button();
  49. this.butContactUs = new System.Windows.Forms.Button();
  50. this.butBuyAndSale = new System.Windows.Forms.Button();
  51. this.butStorage = new System.Windows.Forms.Button();
  52. this.butCustomer = new System.Windows.Forms.Button();
  53. this.butPublisher = new System.Windows.Forms.Button();
  54. this.panel1 = new System.Windows.Forms.Panel();
  55. this.statusBar1 = new System.Windows.Forms.StatusBar();
  56. this.panelInfo = new System.Windows.Forms.StatusBarPanel();
  57. this.panelDate = new System.Windows.Forms.StatusBarPanel();
  58. this.panelTime = new System.Windows.Forms.StatusBarPanel();
  59. this.timer1 = new System.Windows.Forms.Timer(this.components);
  60. this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
  61. ((System.ComponentModel.ISupportInitialize)(this.panelInfo)).BeginInit();
  62. ((System.ComponentModel.ISupportInitialize)(this.panelDate)).BeginInit();
  63. ((System.ComponentModel.ISupportInitialize)(this.panelTime)).BeginInit();
  64. this.SuspendLayout();
  65. // 
  66. // butExit
  67. // 
  68. this.butExit.Image = ((System.Drawing.Image)(resources.GetObject("butExit.Image")));
  69. this.butExit.Location = new System.Drawing.Point(0, 344);
  70. this.butExit.Name = "butExit";
  71. this.butExit.Size = new System.Drawing.Size(120, 64);
  72. this.butExit.TabIndex = 11;
  73. this.toolTip1.SetToolTip(this.butExit, "退出本系统");
  74. this.butExit.Click += new System.EventHandler(this.butExit_Click);
  75. // 
  76. // butContactUs
  77. // 
  78. this.butContactUs.Image = ((System.Drawing.Image)(resources.GetObject("butContactUs.Image")));
  79. this.butContactUs.Location = new System.Drawing.Point(0, 280);
  80. this.butContactUs.Name = "butContactUs";
  81. this.butContactUs.Size = new System.Drawing.Size(120, 64);
  82. this.butContactUs.TabIndex = 10;
  83. this.toolTip1.SetToolTip(this.butContactUs, "联系我们");
  84. this.butContactUs.Click += new System.EventHandler(this.butContactUs_Click);
  85. // 
  86. // butBuyAndSale
  87. // 
  88. this.butBuyAndSale.Image = ((System.Drawing.Image)(resources.GetObject("butBuyAndSale.Image")));
  89. this.butBuyAndSale.Location = new System.Drawing.Point(0, 216);
  90. this.butBuyAndSale.Name = "butBuyAndSale";
  91. this.butBuyAndSale.Size = new System.Drawing.Size(120, 64);
  92. this.butBuyAndSale.TabIndex = 9;
  93. this.toolTip1.SetToolTip(this.butBuyAndSale, "统计图书销售情况");
  94. this.butBuyAndSale.Click += new System.EventHandler(this.butBuyAndSale_Click);
  95. // 
  96. // butStorage
  97. // 
  98. this.butStorage.Image = ((System.Drawing.Image)(resources.GetObject("butStorage.Image")));
  99. this.butStorage.Location = new System.Drawing.Point(0, 144);
  100. this.butStorage.Name = "butStorage";
  101. this.butStorage.Size = new System.Drawing.Size(120, 72);
  102. this.butStorage.TabIndex = 8;
  103. this.toolTip1.SetToolTip(this.butStorage, "库存信息管理");
  104. this.butStorage.Click += new System.EventHandler(this.butStorage_Click);
  105. // 
  106. // butCustomer
  107. // 
  108. this.butCustomer.Image = ((System.Drawing.Image)(resources.GetObject("butCustomer.Image")));
  109. this.butCustomer.Location = new System.Drawing.Point(0, 72);
  110. this.butCustomer.Name = "butCustomer";
  111. this.butCustomer.Size = new System.Drawing.Size(120, 72);
  112. this.butCustomer.TabIndex = 7;
  113. this.butCustomer.TextAlign = System.Drawing.ContentAlignment.TopCenter;
  114. this.toolTip1.SetToolTip(this.butCustomer, "客户信息管理");
  115. this.butCustomer.Click += new System.EventHandler(this.butCustomer_Click);
  116. // 
  117. // butPublisher
  118. // 
  119. this.butPublisher.ForeColor = System.Drawing.SystemColors.ControlText;
  120. this.butPublisher.Image = ((System.Drawing.Image)(resources.GetObject("butPublisher.Image")));
  121. this.butPublisher.Location = new System.Drawing.Point(0, 0);
  122. this.butPublisher.Name = "butPublisher";
  123. this.butPublisher.Size = new System.Drawing.Size(120, 72);
  124. this.butPublisher.TabIndex = 6;
  125. this.butPublisher.TextAlign = System.Drawing.ContentAlignment.TopCenter;
  126. this.toolTip1.SetToolTip(this.butPublisher, "出版社信息管理");
  127. this.butPublisher.Click += new System.EventHandler(this.butPublisher_Click);
  128. // 
  129. // panel1
  130. // 
  131. this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
  132. this.panel1.Location = new System.Drawing.Point(0, 0);
  133. this.panel1.Name = "panel1";
  134. this.panel1.Size = new System.Drawing.Size(120, 408);
  135. this.panel1.TabIndex = 12;
  136. // 
  137. // statusBar1
  138. // 
  139. this.statusBar1.Location = new System.Drawing.Point(120, 386);
  140. this.statusBar1.Name = "statusBar1";
  141. this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
  142.   this.panelInfo,
  143.   this.panelDate,
  144.   this.panelTime});
  145. this.statusBar1.ShowPanels = true;
  146. this.statusBar1.Size = new System.Drawing.Size(476, 22);
  147. this.statusBar1.SizingGrip = false;
  148. this.statusBar1.TabIndex = 14;
  149. // 
  150. // panelInfo
  151. // 
  152. this.panelInfo.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
  153. this.panelInfo.Icon = ((System.Drawing.Icon)(resources.GetObject("panelInfo.Icon")));
  154. this.panelInfo.Text = "欢迎使用本图书管理系统";
  155. this.panelInfo.Width = 256;
  156. // 
  157. // panelDate
  158. // 
  159. this.panelDate.Icon = ((System.Drawing.Icon)(resources.GetObject("panelDate.Icon")));
  160. this.panelDate.Width = 120;
  161. // 
  162. // panelTime
  163. // 
  164. this.panelTime.Icon = ((System.Drawing.Icon)(resources.GetObject("panelTime.Icon")));
  165. // 
  166. // timer1
  167. // 
  168. this.timer1.Enabled = true;
  169. this.timer1.Interval = 1000;
  170. this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
  171. // 
  172. // Form_Main
  173. // 
  174. this.AutoScale = false;
  175. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  176. this.ClientSize = new System.Drawing.Size(596, 408);
  177. this.Controls.Add(this.statusBar1);
  178. this.Controls.Add(this.butExit);
  179. this.Controls.Add(this.butContactUs);
  180. this.Controls.Add(this.butBuyAndSale);
  181. this.Controls.Add(this.butStorage);
  182. this.Controls.Add(this.butCustomer);
  183. this.Controls.Add(this.butPublisher);
  184. this.Controls.Add(this.panel1);
  185. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  186. this.IsMdiContainer = true;
  187. this.MaximizeBox = false;
  188. this.Name = "Form_Main";
  189. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  190. this.Text = "图书管理系统";
  191. this.Load += new System.EventHandler(this.Form_Main_Load);
  192. ((System.ComponentModel.ISupportInitialize)(this.panelInfo)).EndInit();
  193. ((System.ComponentModel.ISupportInitialize)(this.panelDate)).EndInit();
  194. ((System.ComponentModel.ISupportInitialize)(this.panelTime)).EndInit();
  195. this.ResumeLayout(false);
  196. }
  197. #endregion
  198. /// <summary>
  199. /// 应用程序的主入口点。
  200. /// </summary>
  201. [STAThread]
  202. static void Main() 
  203. {
  204. Application.Run(new Form_Main());
  205. }
  206. private System.Windows.Forms.Panel panel1;
  207. private System.Windows.Forms.Button butExit;
  208. private System.Windows.Forms.Button butContactUs;
  209. private System.Windows.Forms.Button butBuyAndSale;
  210. private System.Windows.Forms.Button butStorage;
  211. private System.Windows.Forms.Button butCustomer;
  212. private System.Windows.Forms.Button butPublisher;
  213. private System.Windows.Forms.StatusBar statusBar1;
  214. private System.Windows.Forms.StatusBarPanel panelInfo;
  215. private System.Windows.Forms.StatusBarPanel panelDate;
  216. private System.Windows.Forms.StatusBarPanel panelTime;
  217. private System.Windows.Forms.Timer timer1;
  218. private System.Windows.Forms.ToolTip toolTip1;
  219. Form []child=new Form[6];
  220. private void showChildForm(Form child)
  221. {
  222. child.MdiParent=this;
  223. child.Location=new Point(0,0);
  224. child.Show();
  225. }
  226. private void Form_Main_Load(object sender, System.EventArgs e)
  227. {
  228. child[0]= new Form_Welcome();
  229. showChildForm(child[0]);
  230. }
  231. private void butPublisher_Click(object sender, System.EventArgs e)
  232. {
  233. if(Form_Welcome.submit)
  234. {
  235. child[1]=new Form_Publisher();
  236. showChildForm(child[1]);
  237. }
  238. }
  239. private void butCustomer_Click(object sender, System.EventArgs e)
  240. {
  241. if(Form_Welcome.submit)
  242. {
  243. child[2]=new Form_Customer();
  244. showChildForm(child[2]);
  245. }
  246. }
  247. private void butStorage_Click(object sender, System.EventArgs e)
  248. {
  249. if(Form_Welcome.submit)
  250. {
  251. child[3]=new Form_Storage();
  252. showChildForm(child[3]);
  253. }
  254. }
  255. private void butBuyAndSale_Click(object sender, System.EventArgs e)
  256. {
  257. if(Form_Welcome.submit)
  258. {
  259. child[4]=new Form_BuyAndSale();
  260. showChildForm(child[4]);
  261. }
  262. }
  263. private void butContactUs_Click(object sender, System.EventArgs e)
  264. {
  265. if(Form_Welcome.submit)
  266. {
  267. child[5]=new Form_ConnactUs();
  268. showChildForm(child[5]);
  269. }
  270. }
  271. private void butExit_Click(object sender, System.EventArgs e)
  272. {
  273. if(MessageBox.Show("确实要退出本系统吗","提示信息",MessageBoxButtons.YesNo)==DialogResult.Yes)
  274. {
  275. this.Close();
  276. }
  277. }
  278. private void timer1_Tick(object sender, System.EventArgs e)
  279. {
  280. panelDate.Text=System.DateTime.Now.ToLongDateString();
  281. panelTime.Text=System.DateTime.Now.ToLongTimeString();
  282. }
  283. }
  284. }