コード例 #1
0
ファイル: FInward_exten.cs プロジェクト: CODEXSUN/codexdotnet
        public void ShowLookupForm()
        {
            FrmLookup_LookupHide(null, null);

            frmLookup = new LookupForm();

            switch (lookupColName)
            {
            case INWARDITEMS.STYLE_ID:

                frmLookup.LookupColNames      = new string[] { STYLE.STYLE_NO };
                frmLookup.SelectedPkValue     = editgrid[INWARDITEMS.STYLE_ID, lookupRow].Value;
                frmLookup.AllowNewEntry       = true;
                frmLookup.AllowEmptySelection = true;
                frmLookup.LookupList          = CStyle_exten.LookupNo();
                frmLookup.LoadLookupList();

                break;

            case INWARDITEMS.ARTICLE_ID:

                frmLookup.LookupColNames      = new string[] { ARTICLE.ARTICLE_NO };
                frmLookup.SelectedPkValue     = editgrid[INWARDITEMS.ARTICLE_ID, lookupRow].Value;
                frmLookup.AllowNewEntry       = true;
                frmLookup.AllowEmptySelection = true;
                frmLookup.LookupList          = CArticle_exten.GetforLookup();
                frmLookup.LoadLookupList();

                break;

            default:
                throw new Exception("'" + lookupColName + "' Not Found");
            }
            frmLookup.LookupSelected += new EventHandler(FrmLookup_LookupSelected);
            frmLookup.AfterSelection += new EventHandler(FrmLookup_AfterSelection);
            frmLookup.LookupHide     += new EventHandler(FrmLookup_LookupHide);
            frmLookup.NewEntryNeeded += new LookupForm.NewEntryHandler(FrmLookup_NewEntryNeeded);
            frmLookup.Owner           = this.FindForm();
            //////////
            frmLookup.Show();
            //////////
            int vWidth     = frmLookup.GetAutoWidth();
            int vCellWidth = editgrid.Columns[lookupColName].Width;

            if (vWidth < vCellWidth)
            {
                vWidth = vCellWidth;
            }
            frmLookup.AutoFillLastColumn();

            int vHeight = frmLookup.GetAutoHeight();

            Rectangle screenRect = Global.GetScreenRect(editgrid);

            frmLookup.Bounds = Global.GetSnapRect(screenRect, vWidth, vHeight);
        }
コード例 #2
0
ファイル: LStyle.cs プロジェクト: CODEXSUN/codexdotnet
 void Txt_no_LookupUpdate(object sender, EventArgs e)
 {
     txt_no.LookupList = CStyle_exten.LookupNo();
 }