Пример #1
0
 protected void LoadMyMenu()
 {
     try
     {
         this.Margin  = new System.Windows.Forms.Padding(0);
         this.Padding = new System.Windows.Forms.Padding(0);
         //string section = "MyMenu";
         //string path = Application.StartupPath + "\\Config.ini";
         //string url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_PATIENT);
         string url = Variable.Config.MyPatientsUrl;
         menu1           = GetButton(Constant.MYMENU_PATIENT, url);
         menu1.MouseBack = Image_Over;
         menu1.NormlBack = Image_Normal;
         menu1.DownBack  = Image_Down;
         menu1.TextAlign = ContentAlignment.MiddleCenter;
         menu1.Text      = Constant.MYMENU_PATIENT;
         //url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_APPOINTMENT);
         url             = Variable.Config.MyOrderUrl;
         menu2           = GetButton(Constant.MYMENU_APPOINTMENT, url);
         menu2.MouseBack = Image_Over;
         menu2.NormlBack = Image_Normal;
         menu2.DownBack  = Image_Down;
         menu2.Text      = Constant.MYMENU_APPOINTMENT;
         menu2.TextAlign = ContentAlignment.MiddleCenter;
         //url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_VISIT);
         url             = Variable.Config.MyVisitUrl;
         menu3           = GetButton(Constant.MYMENU_VISIT, url);
         menu3.MouseBack = Image_Down;
         menu3.NormlBack = Image_Normal;
         menu3.DownBack  = Image_Down;
         menu3.Text      = Constant.MYMENU_VISIT;
         menu3.TextAlign = ContentAlignment.MiddleCenter;
         //url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_CONSULT);
         url             = Variable.Config.MyConsultUrl;
         menu4           = GetButton(Constant.MYMENU_CONSULT, url);
         menu4.MouseBack = Image_Down;
         menu4.NormlBack = Image_Normal;
         menu4.DownBack  = Image_Down;
         menu4.Text      = Constant.MYMENU_CONSULT;
         menu4.TextAlign = ContentAlignment.MiddleCenter;
         this.Controls.Clear();
         this.Controls.Add(menu1);
         this.Controls.Add(menu2);
         this.Controls.Add(menu3);
         this.Controls.Add(menu4);
         this.Height = menu1.Height + 5;
     }
     catch (Exception ex)
     {
         LogHelper.WriteException(ex);
     }
 }
Пример #2
0
 protected void LoadMyMenu()
 {            
     try
     {
         this.Margin = new System.Windows.Forms.Padding(0);
         this.Padding = new System.Windows.Forms.Padding(0);
         //string section = "MyMenu";
         //string path = Application.StartupPath + "\\Config.ini";
         //string url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_PATIENT);
         string url = Variable.Config.MyPatientsUrl;
         menu1 = GetButton(Constant.MYMENU_PATIENT, url );
         menu1.MouseBack = Image_Over;
         menu1.NormlBack = Image_Normal;
         menu1.DownBack = Image_Down;
         menu1.TextAlign = ContentAlignment.MiddleCenter;
         menu1.Text = Constant.MYMENU_PATIENT;
         //url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_APPOINTMENT);
         url = Variable.Config.MyOrderUrl;
         menu2 = GetButton(Constant.MYMENU_APPOINTMENT , url );
         menu2.MouseBack = Image_Over;
         menu2.NormlBack = Image_Normal;
         menu2.DownBack = Image_Down;
         menu2.Text = Constant.MYMENU_APPOINTMENT;
         menu2.TextAlign = ContentAlignment.MiddleCenter;
         //url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_VISIT);
         url = Variable.Config.MyVisitUrl;
         menu3 = GetButton(Constant.MYMENU_VISIT , url );
         menu3.MouseBack = Image_Down;
         menu3.NormlBack = Image_Normal;
         menu3.DownBack = Image_Down;
         menu3.Text = Constant.MYMENU_VISIT;
         menu3.TextAlign = ContentAlignment.MiddleCenter;
         //url = TCUtility.IniUtil.ReadIniValue(path, section, Constant.MYMENU_CONSULT);
         url = Variable.Config.MyConsultUrl;
         menu4 = GetButton(Constant.MYMENU_CONSULT , url );
         menu4.MouseBack = Image_Down;
         menu4.NormlBack = Image_Normal;
         menu4.DownBack = Image_Down;
         menu4.Text = Constant.MYMENU_CONSULT;
         menu4.TextAlign = ContentAlignment.MiddleCenter;
         this.Controls.Clear();
         this.Controls.Add(menu1);
         this.Controls.Add(menu2);
         this.Controls.Add(menu3);
         this.Controls.Add(menu4);
         this.Height = menu1.Height + 5;
     }
     catch (Exception ex)
     {
         LogHelper.WriteException(ex);
     }
 }
Пример #3
0
        /// <summary>
        /// 获得按钮函数
        /// </summary>
        /// <param name="menuname"></param>
        /// <param name="imagename"></param>
        /// <returns></returns>
        protected SkinButtom GetMenu2(string menuname, string imagename, string url)
        {
            SkinButtom menu = new SkinButtom();

            menu.Cursor = Cursors.Hand;
            //menu.Text = menuname;
            menu.AutoSize  = false;
            menu.Height    = 36;
            menu.Width     = 36;
            menu.Tag       = url;
            menu.DrawType  = DrawStyle.Img;
            menu.NormlBack = GetImage(imagename + "_btn_normal.png");
            menu.DownBack  = GetImage(imagename + "_btn_down.png");
            menu.MouseBack = GetImage(imagename + "_btn_hover.png");
            menu.Click    += new EventHandler(menu_Click);
            return(menu);
        }
Пример #4
0
        protected SkinButtom GetButton(string name, string url)
        {
            SkinButtom menu1 = null;

            try
            {
                menu1           = new SkinButtom();
                menu1.DrawType  = DrawStyle.Img;
                menu1.Height    = 32;
                menu1.Text      = name;
                menu1.Margin    = new System.Windows.Forms.Padding(0);
                menu1.Padding   = new System.Windows.Forms.Padding(0);
                menu1.Cursor    = Cursors.Hand;
                menu1.TextAlign = ContentAlignment.MiddleCenter;
                menu1.Click    += new EventHandler(menu1_Click);
                //menu1.Tag = name;
                menu1.Tag = url;
            }
            catch (Exception ex)
            {
                TCUtility.LogHelper.WriteException(ex);
            }
            return(menu1);
        }
Пример #5
0
 /// <summary>
 /// 获得按钮函数
 /// </summary>
 /// <param name="menuname"></param>
 /// <param name="imagename"></param>
 /// <returns></returns>
 protected SkinButtom GetMenu2(string menuname , string imagename , string url )
 {
     SkinButtom menu = new SkinButtom();
     menu.Cursor = Cursors.Hand;
     //menu.Text = menuname;
     menu.AutoSize = false;
     menu.Height = 36;
     menu.Width = 36;
     menu.Tag = url;
     menu.DrawType = DrawStyle.Img;
     menu.NormlBack = GetImage( imagename + "_btn_normal.png");
     menu.DownBack = GetImage(imagename + "_btn_down.png");
     menu.MouseBack = GetImage(imagename + "_btn_hover.png");
     menu.Click += new EventHandler(menu_Click);
     return menu;
 }
Пример #6
0
 protected SkinButtom GetButton(string name , string url )
 {
     SkinButtom menu1 = null;
     try
     {
         menu1 = new SkinButtom();
         menu1.DrawType = DrawStyle.Img;
         menu1.Height = 32;
         menu1.Text = name;
         menu1.Margin = new System.Windows.Forms.Padding(0);
         menu1.Padding = new System.Windows.Forms.Padding(0);
         menu1.Cursor = Cursors.Hand;
         menu1.TextAlign = ContentAlignment.MiddleCenter;               
         menu1.Click += new EventHandler(menu1_Click);
         //menu1.Tag = name;
         menu1.Tag = url;
     }
     catch (Exception ex)
     {
         TCUtility.LogHelper.WriteException(ex);
     }
     return menu1;
 }