首页 新闻 会员 周边 捐助

winform 房态盘怎么实现

0
悬赏园豆:5 [已解决问题] 解决于 2014-01-21 22:49

winform 房态盘怎么实现 winform 房态盘怎么实现winform 房态盘怎么实现

c#
程序员编程日记的主页 程序员编程日记 | 初学一级 | 园豆:6
提问于:2014-01-21 11:10
< >
分享
最佳答案
0

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 qxdHotels.Rooms.WinUI.Room.Status {     public partial class RoomStatus :Xw.WinUI.BaseForm      {         qxdHotels.Rooms.BLL.Room.RoomInfo _RoomInfoBLL = new qxdHotels.Rooms.BLL.Room.RoomInfo();         public RoomStatus()         {             InitializeComponent();             loadRoomStatus();

        }         #region loadRoomStatus

        void loadRoomStatus()         {             DataTable myDt = _RoomInfoBLL.GetRoomInfo("a09b5c17fe724761a3ffc6827509b508");             //Xw.DAL.DataAccessLib.DataAccess.ExecuteDataTable("SELECT * FROM  [ROOM_INFOMATION]");             if (myDt.Rows.Count > 0)             {                 int row = 10;//每行控件数量                 int column = 7;//每列控件数量                 int count = 0;//设置控件数量基数

                for (int i = 1; i <= row; i++)                 {                     for (int j = 1; j <= column; j++)                     {                         int k = myDt.Rows.Count;                         Panel roomStatePanel = new Panel();                         roomStatePanel.Width = 100;                         roomStatePanel.Height = 100;                         //启用双缓冲绘制控件                         DoubleBuffered = true;                     //    roomStatePanel.Text = "aaaaa2343434343";//设置控件显示文本                         roomStatePanel.Name = Convert.ToString(count);//设置控件name属性

                        PictureBox pic = new PictureBox();                         pic.BackgroundImageLayout = ImageLayout.Stretch;                         pic.Name = "pic" + i.ToString();                         pic.Height = 50;                         pic.Width = 53;                         pic.Location = new Point(10, 10);                         pic.BackgroundImage = Image.FromFile(@"F:\空房.jpg");                         pic.Tag = "aaaa";                         pic.Click += new EventHandler(pic_Click);                         pic.MouseEnter += new EventHandler(pic_MouseEnter);                         pic.MouseLeave += new EventHandler(pic_MouseLeave);                         roomStatePanel.Controls.Add(pic);

                        Label pc = new Label();

                        pc.Name = "pc" + i.ToString();                         pc.Height = 50;                         pc.Width = 53;                         pc.Text = i.ToString ()+"*"+j.ToString ();                         pc.Location = new Point(20, 60);                         roomStatePanel.Controls.Add(pc);                         count++;

                        //判断控件数量是否大于数据表中数据总记录数                         if (k < count)                         {                             roomStatePanel.Visible = false;                         }                         flPanel.Controls.Add(roomStatePanel);                     }                 }             }         }                 #endregion         #region pic_Click         void pic_Click(object sender, EventArgs e)         {             try             {                    PictureBox aa = sender as  PictureBox;                    MessageBox.Show(aa.Tag.ToString ());

             //   Label lbl = sender as Label;              //   DataRow row = lbl.Tag as DataRow;                // LoadRoomByTypeID(row, 0);             }             catch (Exception ex)             {

            }

        }         #endregion         #region pic_MouseLeave         void pic_MouseLeave(object sender, EventArgs e)         {             PictureBox aa = sender as  PictureBox;               aa.BackgroundImage = Image.FromFile(@"F:\11.jpg");             //Label lbl = sender as Label;             //lbl.Font = new Font(lbl.Font, FontStyle.Regular);             //lbl.Cursor = Cursors.Default;             //lbl.ForeColor = btnRoomType.ForeColor;         }         #endregion         #region pic_MouseEnter         void pic_MouseEnter(object sender, EventArgs e)         {

            PictureBox aa = sender as  PictureBox;

            aa.BackgroundImage = Image.FromFile(@"F:\11.jpg");             //Label lbl = sender as Label;             //lbl.Font = new Font(lbl.Font, FontStyle.Bold);             //lbl.Cursor = Cursors.IBeam;         }         #endregion     } }

程序员编程日记 | 初学一级 |园豆:6 | 2014-01-21 17:19
其他回答(3)
0

Google了一下,才知道啥叫”房态盘“,学习了。

我也有个问题,Winform 酒店管理系统怎么实现,Google了一下,知道了,给钱,买一套。

爱编程的大叔 | 园豆:30844 (高人七级) | 2014-01-21 12:05
0

image控件 预定,入住换个图片 感觉是这样的

收获园豆:5
wolfy | 园豆:2636 (老鸟四级) | 2014-01-21 13:28
0

感觉只能是自己动态的更换背景图片了!更换状态!目前正在做B/S会所房间管理系统。思路是这样的。

大楚打码人 | 园豆:4313 (老鸟四级) | 2014-01-21 14:58
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册