private void frmSettingConfig_Load(object sender, EventArgs e) { this.LoadSettingConfig(); this.EnableVScrollBar(); } private void LoadSettingConfig() { try { LogWrite.Log.InformationWrite("Load Setting Config."); string filepath = Application.StartupPath; if (Directory.Exists(filepath) == true) { DirectoryInfo di = new DirectoryInfo(filepath); foreach (FileInfo item in di.GetFiles()) { if (item.Name.Contains("SettingConfig")) { mSettingConfigList.Add(item.Name); } } } else { MessageBox.Show("Does not Exist Setting Config File in Directory !"); } this.ShowSettingConfig(); } catch (Exception ex) { MessageBox.Show("Load Setting Config Error !"); LogWrite.Log.InformationWrite("Load Setting Config Error" + ex.ToString()); } } private void EnableVScrollBar() { VScrollBar vScroller = new VScrollBar(); this.lbxSettingConfigList.Controls.Add(vScroller); vScroller.Height = lbxSettingConfigList.Height; vScroller.Width = 30; vScroller.Dock = DockStyle.Right; vScroller.Scroll += new System.Windows.Forms.ScrollEventHandler(vScoller_Scroll); } private void vScoller_Scroll(object sender, ScrollEventArgs e) { // How do I ? in this block. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)