当前位置: 首页>>代码示例>>C#>>正文


C# CheckBox.SetPosition方法代码示例

本文整理汇总了C#中CheckBox.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# CheckBox.SetPosition方法的具体用法?C# CheckBox.SetPosition怎么用?C# CheckBox.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CheckBox的用法示例。


在下文中一共展示了CheckBox.SetPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Check

        /// <summary>
        /// Initializes a new instance of the <see cref="Check"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public Check(Controls.Control parent)
            : base(parent)
        {
            m_CheckBox = new CheckBox(this);
            m_CheckBox.ShouldDrawBackground = false;
            m_CheckBox.CheckChanged += OnValueChanged;
            m_CheckBox.IsTabable = true;
            m_CheckBox.KeyboardInputEnabled = true;
            m_CheckBox.SetPosition(2, 1);

            Height = 18;
        }
开发者ID:FloodProject,项目名称:flood,代码行数:16,代码来源:Check.cs

示例2: OptionScene

        public OptionScene()
        {
            Console.WriteLine("---- option scene ----");
            this.Camera.SetViewFromViewport();

            Sce.PlayStation.HighLevel.UI.Panel panel = new Panel();//create panel
            panel.Width = Director.Instance.GL.Context.GetViewport().Width;
            panel.Height = Director.Instance.GL.Context.GetViewport().Height;

            Sce.PlayStation.HighLevel.UI.Label title_label = new Sce.PlayStation.HighLevel.UI.Label();//title label
            Sce.PlayStation.HighLevel.UI.Label music_label = new Sce.PlayStation.HighLevel.UI.Label();//music label
            Sce.PlayStation.HighLevel.UI.Label sound_label = new Sce.PlayStation.HighLevel.UI.Label();//sound label

            labelSetting(title_label,                   //label name
                         "Option",   					//label content
                         panel.Width/10,				//x position
                         10,							//y position
                         250,							//x size
                         100,							//y size
                         64,							//font size
                         FontStyle.Bold,				//font style
                         new UIColor(0, 255, 0, 255));	//font color

            labelSetting(music_label,
                         "Music :",
                         panel.Width/7,
                         panel.Height/5,
                         150,
                         100,
                         32,
                         FontStyle.Regular,
                         new UIColor(0, 255, 0, 255));

            labelSetting(sound_label,
                         "Sound :",
                         panel.Width/7,
                         panel.Height/3f,
                         150,
                         100,
                         32,
                         FontStyle.Regular,
                         new UIColor(0, 255, 0, 255));

            Sce.PlayStation.HighLevel.UI.CheckBox checkMusicButton = new CheckBox(); //music
            checkMusicButton.Checked = isMusicCheckboxChanged;
            checkMusicButton.SetPosition(panel.Width/3,panel.Height/4.5f);
            checkMusicButton.SetSize(50,50);
            checkMusicButton.CheckedChanged += HandleCheckMusicButtonCheckedChanged;

            sliderForMusic = new Sce.PlayStation.HighLevel.UI.Slider();
            sliderForMusic.SetPosition(panel.Width/2f,panel.Height/4.5f);
            sliderForMusic.SetSize(200,50);
            sliderForMusic.MinValue = 0;
            sliderForMusic.MaxValue = 1;
            sliderForMusic.Value = 0.5f;
            sliderForMusic.ValueChanging += HandleSliderForMusicValueChanging;//end music

            Sce.PlayStation.HighLevel.UI.CheckBox checkSoundButton = new CheckBox();//sound
            checkSoundButton.Checked = isSoundCheckboxChanged;
            checkSoundButton.SetPosition(panel.Width/3,panel.Height/2.5f);
            checkSoundButton.SetSize(50,50);
            checkSoundButton.CheckedChanged += HandleCheckSoundButtonCheckedChanged;

            sliderForSound = new Sce.PlayStation.HighLevel.UI.Slider();
            sliderForSound.SetPosition(panel.Width/2f,panel.Height/2.5f);
            sliderForSound.SetSize(200,50);
            sliderForSound.MinValue = 0;
            sliderForSound.MaxValue = 1;
            sliderForSound.Value = Support.SoundSystem.volumOfSound;
            sliderForSound.ValueChanging += HandleSliderForSoundValueChanging;//end sound

            Button buttonUI1 = new Button(); //buttons
            buttonUI1.Name = "go back";
            buttonUI1.Text = "go back";
            buttonUI1.Width = 250;
            buttonUI1.Height = 50;
            buttonUI1.Alpha = 0.8f;
            buttonUI1.SetPosition(panel.Width/5,panel.Height - 100);
            buttonUI1.TouchEventReceived += (sender, e) => {
                Support.SoundSystem.Instance.PlayNoClobber("ButtonClick.wav");
                Director.Instance.ReplaceScene(new MenuScene());
            };

            Button buttonUI2 = new Button();
            buttonUI2.Name = "reset";
            buttonUI2.Text = "reset";
            buttonUI2.Width = 250;
            buttonUI2.Height = 50;
            buttonUI2.Alpha = 0.8f;
            buttonUI2.SetPosition(panel.Width/2f,panel.Height - 100);
            buttonUI2.TouchEventReceived += (sender, e) => {
                Support.SoundSystem.Instance.PlayNoClobber("ButtonClick.wav");
            };

            _uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
            panel.AddChildLast(title_label);//add widgets in panel
            panel.AddChildLast(music_label);
            panel.AddChildLast(sound_label);
            panel.AddChildLast(checkMusicButton);
            panel.AddChildLast(checkSoundButton);
//.........这里部分代码省略.........
开发者ID:Promark,项目名称:PSM_Missile_Command,代码行数:101,代码来源:OptionScene.cs


注:本文中的CheckBox.SetPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。