Beispiel #1
0
        public override object EditValue(ITypeDescriptorContext context,
                                         IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService wfes = provider.GetService(
                typeof(IWindowsFormsEditorService)) as
                                              IWindowsFormsEditorService;

            if (wfes != null)
            {
                frmContrast _frmContrast = new frmContrast();

                _frmContrast.trackBar1.Value = (int)value;
                _frmContrast.BarValue        = _frmContrast.trackBar1.Value;
                _frmContrast._wfes           = wfes;

                wfes.DropDownControl(_frmContrast);
                value = _frmContrast.BarValue;
            }
            return(value);
        }
Beispiel #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService wfes = provider.GetService (typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;

            if (wfes != null)
            {
                var instance = context.Instance;
                var prop = context.PropertyDescriptor;
                frmContrast _frmContrast = new frmContrast ();
                _frmContrast.trackBar1.Value = (int)((float)value * 100);
                _frmContrast.trackBar1.MouseUp += (sender, e) =>
                {
                    wfes.CloseDropDown ();
                };
                _frmContrast.BarValue = ((float)value);
                _frmContrast._wfes = wfes;

                wfes.DropDownControl(_frmContrast);
                value = _frmContrast.BarValue;
            }
            return value;
        }
Beispiel #3
0
            public override object EditValue(ITypeDescriptorContext context,
                IServiceProvider provider, object value)
            {
                IWindowsFormsEditorService wfes = provider.GetService(
                    typeof(IWindowsFormsEditorService)) as
                    IWindowsFormsEditorService;

                if (wfes != null)
                {
                    frmContrast _frmContrast = new frmContrast();

                    //				_frmContrast.trackBar1.Value = (int) value;
                    //				_frmContrast.BarValue = _frmContrast.trackBar1.Value;

                    _frmContrast.BarValue = (int)value;
                    _frmContrast._wfes = wfes;
                    _frmContrast.rearrange(2);

                    //				_frmContrast.BarValue = _frmContrast.trackBar1.Value;
                    //_frmContrast.imageListBox1.SelectedIndex =1+ (int)value;
                    wfes.DropDownControl(_frmContrast.imageListBox1);
                    value = _frmContrast.BarValue;

                }
                return value;
            }