啊鑫
2024-07-09 0552fcc8cb73fc3021e2915129f55a42ed3f20e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#region
 
using System;
using System.Windows.Forms;
using CSFrameworkV5.Common;
using CSFrameworkV5.Language;
 
#endregion
 
namespace CSFrameworkV5.Library
{
    /// <summary>
    ///     模块主窗体容器
    /// </summary>
    public partial class frmModuleContainer : frmBaseChild
    {
        public frmModuleContainer()
        {
            InitializeComponent();
        }
 
        public override void DoCreateShortCut()
        {
            Msg.Warning(LanLib.Get("当前窗体不能设置!"));
        }
 
        private void frmModuleContainer_Load(object sender, EventArgs e)
        {
            SetLanguage();
        }
 
        /// <summary>
        ///     显示模块主窗体容器的按钮
        /// </summary>
        public override void InitButtons()
        {
            //模块容器,要禁用关闭按钮
            _buttons.GetButtonByName("btnClose").Enable = false;
            ControlBox = false;
        }
 
        public override void SetLanguage()
        {
            base.SetLanguage();
 
            //模块容器窗体与主窗体结合并存的,实际是设置主窗体的语言
            _buttons.GetButtonByName("btnHelp").Caption = LanLib.Get("帮助");
            _buttons.GetButtonByName("btnAbout").Caption = LanLib.Get("关于");
            _buttons.GetButtonByName("btnListItem").Caption =
                LanLib.Get("列表样式");
            _buttons.GetButtonByName("btnTree").Caption = LanLib.Get("树形样式");
            _buttons.GetButtonByName("btnLanguage").Caption =
                LanLib.Get("设置语言");
 
            if (xtraTabControl1.SelectedTabPage != null)
            {
                var moduleForm = (Form)xtraTabControl1.SelectedTabPage.Tag;
                Text = LanLib.Get(moduleForm.GetType().FullName,
                    moduleForm.Text);
            }
        }
    }
}