예제 #1
0
        public override Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum)
        {
            if (propEnum.Property.Value.ReadOnly)
            {
                PropInPlaceTextbox edit;

                if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceTextbox))
                {
                    edit         = new PropInPlaceTextbox(false);
                    edit.Visible = false;
                    edit.Parent  = mParentWnd;
                    mInPlaceCtrl = edit;
                }
                else
                {
                    edit = (PropInPlaceTextbox)mInPlaceCtrl;
                }

                NotifyInPlaceControlCreated(propEnum);

                edit.OwnerPropertyEnumerator = propEnum;
                edit.Font = propEnum.Property.Value.Font;
//                if (edit.Text != propEnum.Property.Value.DisplayString)
//                  edit.Text = propEnum.Property.Value.DisplayString;
            }
            else
            {
                PropInPlaceDateTime dateTime;

                if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceDateTime))
                {
                    dateTime         = new PropInPlaceDateTime();
                    dateTime.Visible = false;
                    dateTime.Parent  = mParentWnd;
#if _DOTNET2
                    dateTime.AutoSize = false;
#endif
                    mInPlaceCtrl = dateTime;
                }
                else
                {
                    dateTime = (PropInPlaceDateTime)mInPlaceCtrl;
                }

                dateTime.OwnerPropertyEnumerator = propEnum;
                dateTime.Font = propEnum.Property.Value.Font;
//                dateTime.Value = (DateTime)propEnum.Property.Value.GetValue();
            }

            MoveControl(valueRect, propEnum);

            return(base.ShowControl(valueRect, propEnum));
        }
예제 #2
0
        public override Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum)
        {
            if (propEnum.Property.Value.ReadOnly)
            {
                PropInPlaceTextbox edit;

                if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceTextbox))
                {
                    edit = new PropInPlaceTextbox(false);
                    edit.Visible = false;
                    edit.Parent = mParentWnd;
                    mInPlaceCtrl = edit;
                }
                else
                    edit = (PropInPlaceTextbox)mInPlaceCtrl;

                NotifyInPlaceControlCreated(propEnum);

                edit.OwnerPropertyEnumerator = propEnum;
                edit.Font = propEnum.Property.Value.Font;
//                if (edit.Text != propEnum.Property.Value.DisplayString)
  //                  edit.Text = propEnum.Property.Value.DisplayString;
            }
            else
            {
                PropInPlaceDateTime dateTime;

                if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceDateTime))
                {
                    dateTime = new PropInPlaceDateTime();
                    dateTime.Visible = false;
                    dateTime.Parent = mParentWnd;
#if _DOTNET2
                    dateTime.AutoSize = false;
#endif
                    mInPlaceCtrl = dateTime;
                }
                else
                    dateTime = (PropInPlaceDateTime)mInPlaceCtrl;

                dateTime.OwnerPropertyEnumerator = propEnum;
                dateTime.Font = propEnum.Property.Value.Font;
//                dateTime.Value = (DateTime)propEnum.Property.Value.GetValue();
            }

            MoveControl(valueRect, propEnum);

            return base.ShowControl(valueRect, propEnum);
        }