PictureButton m_btCancel = new PictureButton(); //退出按钮 public ShowHand() { InitializeComponent(); m_ImageBack = Properties.Resources.SHOWHAND_COMFIRE; m_btOK.Create(true, true, new Rectangle(), this, 0); m_btCancel.Create(true, true, new Rectangle(), this, 0); m_btOK.SetButtonImage(Properties.Resources.BT_YES1); m_btCancel.SetButtonImage(Properties.Resources.BT_NO1); m_btOK.Click += OnOK; m_btCancel.Click += OnCancel; this.ClientSize = new Size(m_ImageBack.Width, m_ImageBack.Height); m_btOK.Left = (this.Width / 2 - m_btOK.Width) / 2; m_btOK.Top = this.ClientSize.Height - m_btOK.Height - 2; m_btCancel.Left = (this.Width / 2 - m_btCancel.Width) / 2 + this.Width / 2; m_btCancel.Top = m_btOK.Top; m_bTimes = 5; timer1.Interval = 5 * 1000; timer1.Enabled = true; timer2.Interval = 1000; timer2.Enabled = true; }
Bitmap m_ImageNumber; //数字资源 public GoldControl() { InitializeComponent(); //界面变量 m_nWidth = 0; m_nCellCount = 0; //设置变量 m_lMaxGold = 0; m_lMinGold = 0; //ZeroMemory(m_lGoldCell,sizeof(m_lGoldCell)); //加载资源 //HINSTANCE hInstance=AfxGetInstanceHandle(); m_ImageLeft = Properties.Resources.LEFT; m_ImageMid = Properties.Resources.MID; m_ImageRight = Properties.Resources.RIGHT; m_ImageNumber = Properties.Resources.NUMBER; //创建控件 Rectangle rcCreate = new Rectangle(); m_btMaxScore.Create(true, true, rcCreate, this, IDC_MAXSCORE); m_btMinScore.Create(true, true, rcCreate, this, IDC_MINSCORE); m_btOK.Create(true, true, rcCreate, this, IDC_OK); m_btCancel.Create(true, true, rcCreate, this, IDC_CANCEL); //加载位图 m_btMaxScore.SetButtonImage(Properties.Resources.BT_MAX); m_btMinScore.SetButtonImage(Properties.Resources.BT_MIN); m_btOK.SetButtonImage(Properties.Resources.BT_OK); m_btCancel.SetButtonImage(Properties.Resources.BT_CANCEL); m_btMaxScore.Click += OnMaxScore; m_btMinScore.Click += OnMinScore; m_btOK.Click += OnOKScore; m_btCancel.Click += OnCancelScore; }