/// <summary>
        /// Returns the number of rows that can be displayed in the ListView
        /// </summary>
        /// <returns>Number of visible rows</returns>
        private int GetListViewVisisbleRows()
        {
            // Get the maximum number of visible rows in listbox
            // (Note: requires sending win32 message to listview)
            int result = ListViewUtils.GetVisibleRows(listView);

            return(result);
        }
Ejemplo n.º 2
0
 private void btnSaveBOMList_Click(object sender, EventArgs e)
 {
     try
     {
         saveBOMListFileDialog.FileName = AppSettings.WorkingFolder + @"\default.bomlst";
         if (saveBOMListFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             ListViewUtils.SaveListview(lvBOMList, saveBOMListFileDialog.FileName);
         }
     }
     catch (Exception ex)
     {
         WriteStatus("btnLoadBOMList_Click ERROR: " + ex.ToString());
     }
 }
Ejemplo n.º 3
0
 private void btnLoadBOMList_Click(object sender, EventArgs e)
 {
     try
     {
         if (openBOMListFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             lvBOMList.Items.Clear();
             ListViewUtils.LoadListview(lvBOMList, openBOMListFileDialog.FileName);
         }
     }
     catch (Exception ex)
     {
         WriteStatus("btnLoadBOMList_Click ERROR: " + ex.ToString());
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="HighPerformanceListViewControl"/> class.
        /// </summary>
        public HighPerformanceListView()
        {
            InitializeComponent();

            // Hide verticle scroll bar until it is needed
            vScrollBar.Visible = false;

            // Add double buffering and borderselect to the list view styles:
            // Double buffering will help prevent flicker when drawing of the control
            ListViewUtils.AddStylesToExistingStyles(listView, ListViewUtils.LVS_EX_DOUBLEBUFFER | ListViewUtils.LVS_EX_BORDERSELECT);

            // Setup listview for manually handling displayed items, and vertical scroll bar
            listView.FullRowSelect = true;

            //
            listView.OwnerDraw = false;
        }
Ejemplo n.º 5
0
        void LoadLists()
        {
            // TODO: in future get these from xml setup file
            try
            {
                ListViewUtils.LoadListview(lvBOMList, AppSettings.WorkingFolder + @"\default.bomlst");
            }
            catch
            {
                MessageBox.Show("Could not load bom list", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            try
            {
                txtIgnoreParts.Text = System.IO.File.ReadAllText(AppSettings.WorkingFolder + @"\parts.ignore");
            }
            catch
            {
                MessageBox.Show("Could not load the parts to be ignored list", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Hide native vertical scroll bar, since we are handling vertical scrolling with our own scroll bar.
 /// This method ensures that the scroll bar does not accidentally who up.
 /// </summary>
 private void HideNativeVerticalScrollBar()
 {
     ListViewUtils.ShowVerticalScrollBar(listView, false);
 }