zoukankan      html  css  js  c++  java
  • 酒店管理系统房态图的效果制作

    没什么技术含量就是给自己一个记忆的空间。
       1:          private void bnt_在住房_Click(object sender, EventArgs e)
       2:          {
       3:              for (int i = 0; i < Convert.ToInt32(textBox1.Text); i++)
       4:              {
       5:                  // Label lb = new Label();//本来是用标签的,后来发现用按钮更好。
       6:                  Button lb = new Button(); //声明一个按钮型的变量,并实例化;
       7:                  lb.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);//设置控件之间的距离;
       8:                  lb.Width = 80;                  //设置宽度为80;
       9:                  lb.Height = 80;                 //设置高度为80;
      10:                  lb.Text = i.ToString("000")+"\n\t标准单人间";    //把循环变量I转换成字符串类型;
      11:                  lb.BackColor = Color.PowderBlue;//设置控件的背景色;
      12:                  lb.ForeColor = Color.Red;       //设置控件的前景色为红色,也就是文字的颜色;
      13:                  lb.TextAlign = ContentAlignment.TopCenter;
      14:                  //lb.MouseMove += new MouseEventHandler(button_MouseMove);                
      15:                  lb.Click += new System.EventHandler(this.clearButton_Click);//用委托实现让控件响应单击事件;              
      16:                  //lb.MouseLeave += new EventHandler(button_MouseLeave);
      17:                  //lb.Image = Image.FromFile(@"F:/VS2008ImageLibrary/Actions/AddTableHH.bmp");//设置控件的图片;
      18:                  lb.ImageAlign = ContentAlignment.MiddleCenter;//设置控件上的图片对齐方式;
      19:                  for (int n = 0; n < 3; n++)
      20:                  {
      21:                      Label lb1 = new Label();
      22:                      lb1.BackColor = Color.SlateGray;
      23:                      lb1.Location = new Point(n * 20 + 7, 60);
      24:                      lb1.Width = 10;
      25:                      lb1.Height = 11;
      26:                      lb.Controls.Add(lb1);
      27:                  }
      28:                  this.flowLayoutPanel1.Controls.Add(lb);
      29:              }
      30:          }

    下面是效果图。

    image

  • 相关阅读:
    how to pass a Javabean to server In Model2 architecture.
    What is the Web Appliation Archive, abbreviation is "WAR"
    Understaning Javascript OO
    Genetic Fraud
    poj 3211 Washing Clothes
    poj 2385 Apple Catching
    Magic Star
    关于memset的用法几点
    c++ 函数
    zoj 2972 Hurdles of 110m
  • 原文地址:https://www.cnblogs.com/fanghui/p/2774272.html
Copyright © 2011-2022 走看看