Пример #1
0
        public virtual bool HideCustomCtrl(out string val)
        {
            bool bRet = false;

            val = "";
            do
            {
                if (m_customCtrl == null)
                {
                    break;
                }
                Debug.WriteLine("hideDtp");
                m_customCtrl.hide();

                if (m_customCtrl == null)
                {
                    break;
                }
                if (m_customCtrl.isChanged())
                {
                    bRet = true;
                    val  = m_customCtrl.getValue();
                }

                this.Controls.Remove(m_customCtrl.getControl());
                m_customCtrl.Dispose();
                m_customCtrl = null;
            } while (false);
            return(bRet);
        }
Пример #2
0
        public virtual void HideCustomCtrl()
        {
            if (m_customCtrl != null)
            {
                Debug.WriteLine("hideDtp");
                m_customCtrl.hide();

                if (m_customCtrl.isChanged())
                {
                    var val = m_customCtrl.getValue();
                    this.CurrentCell.Value = m_customCtrl.getValue();
                }

                this.Controls.Remove(m_customCtrl.getControl());
                m_customCtrl.Dispose();
                m_customCtrl = null;
            }
        }
Пример #3
0
        public virtual void showCustomCtrl(int col, int row)
        {
            Debug.WriteLine("showDtp");

            //fix error control not hide
            if (m_customCtrl != null)
            {
                Debug.Assert(false, "previous ctrl should be disposed");
                m_customCtrl.Dispose();
                m_customCtrl = null;
                return;
            }

            if (m_tblInfo.m_cols[col].m_type == TableInfo.ColInfo.ColType.dateTime)
            {
                m_customCtrl = new myDateTimePicker(this);
            }
            else if (m_tblInfo.m_cols[col].m_lookupData != null)
            {
                m_customCtrl = new myComboBox(this, m_tblInfo.m_cols[col].m_lookupData);
            }
            if (m_customCtrl != null)
            {
                m_customCtrl.m_iRow = row;
                m_customCtrl.m_iCol = col;
                this.Controls.Add(m_customCtrl.getControl());
                if (CurrentCell.Value != null)
                {
                    m_customCtrl.setValue(this.CurrentCell.Value.ToString());
                }
                Rectangle rec = this.GetCellDisplayRectangle(col, row, true);
                m_customCtrl.show(rec);

                //ActiveControl = m_dtp;
                this.BeginEdit(true);
            }
        }