/// <summary> /// auto adjust title column width /// </summary> public void ResizeColumns() { aliasWidth = listViewSource.Width - typeWidth - scannedWidth - MyDPI.ScaleDPIDimension(5); listViewSource.Columns[0].Width = aliasWidth; listViewSource.Columns[1].Width = typeWidth; listViewSource.Columns[2].Width = scannedWidth; }
public void ResizeColumns() { nameWidth = listView.Width - MyDPI.ScaleDPIDimension(typeWidth) - MyDPI.ScaleDPIDimension(sizeWidth) - MyDPI.ScaleDPIDimension(5); // count is fall back in case extern call doesnt work int nbrItems = listView.Items.Count; if (MyUser32_GetWindow.IsVerticalScrollbarVisible(listView.Handle) || nbrItems > 8) { nameWidth -= MyDPI.ScaleDPIDimension(20); } listView.Columns[0].Width = nameWidth; listView.Columns[1].Width = MyDPI.ScaleDPIDimension(typeWidth); listView.Columns[2].Width = MyDPI.ScaleDPIDimension(sizeWidth); }
private void NormalizeCriteriaWidth() { // check if vertical scroll bar is present, normalize width of controls if (flowLayoutPanelCriteria.VerticalScroll.Visible) { // vertical scroll bar showing, so reduce width of controls foreach (Control control in flowLayoutPanelCriteria.Controls) { control.Width = flowLayoutPanelCriteria.Width - MyDPI.ScaleDPIDimension(25); } } else { // no vertical scroll bar foreach (Control control in flowLayoutPanelCriteria.Controls) { control.Width = flowLayoutPanelCriteria.Width - MyDPI.ScaleDPIDimension(6); } } }
private void buttonToggle_Click(object sender, EventArgs e) { if (textBoxTags.Visible) { textBoxTags.Hide(); } else { int textBoxWidth = flowLayoutPanel.Width - MyDPI.ScaleDPIDimension(buttonToggle.Width) - MyDPI.ScaleDPIDimension(25); // count is fall back in case extern call doesnt work int nbrControls = flowLayoutPanel.Controls.Count; if (MyUser32_GetWindow.IsVerticalScrollbarVisible(flowLayoutPanel.Handle) || nbrControls > 8) { textBoxWidth -= MyDPI.ScaleDPIDimension(20); } textBoxTags.Width = textBoxWidth; textBoxTags.Show(); } }
/// <summary> /// auto adjust title column width /// </summary> public void ResizeColumns() { int titleWidth = listView.Width - MyDPI.ScaleDPIDimension(GetColumnWidth(visibleColumnIndex)) - MyDPI.ScaleDPIDimension(5); // count is fall back in case extern call doesnt work int nbrItems = listView.Items.Count; if (listView.Handle != null && MyUser32_GetWindow.IsVerticalScrollbarVisible(listView.Handle) || nbrItems > 24) { titleWidth -= MyDPI.ScaleDPIDimension(20); } /// set all to 0 foreach (KeyValuePair <int, string> sortColumn in FilterEnums.sortColumn.ToList().OrderBy(s => s.Key)) { listView.Columns[sortColumn.Key].Width = 0; } // now set visible columns listView.Columns[0].Width = titleWidth; listView.Columns[visibleColumnIndex].Width = MyDPI.ScaleDPIDimension(GetColumnWidth(visibleColumnIndex)); }
private void UserControlVideoInfo_Load(object sender, EventArgs e) { this.MinimumSize = new Size(350, 600); comboBoxYear.Items.Clear(); int paddingYears = 5; int currentYear = System.DateTime.UtcNow.Year + paddingYears; for (int year = currentYear; year >= 1950; year--) { comboBoxYear.Items.Add(year); } comboBoxRating.Items.Clear(); for (int rating = 10; rating >= 0; rating--) { comboBoxRating.Items.Add(rating); } comboBoxIMDBRating.Items.Clear(); for (int rating = 10; rating >= 0; rating--) { comboBoxIMDBRating.Items.Add(rating); } comboBoxPlayCount.Items.Clear(); for (int playCount = 0; playCount <= 20; playCount++) { comboBoxPlayCount.Items.Add(playCount); } comboBoxSource.Items.Clear(); comboBoxSource.Items.Add("Bluray"); comboBoxSource.Items.Add("DVD"); comboBoxSource.Items.Add("Stream"); comboBoxVersion.Items.Clear(); comboBoxVersion.Items.Add("Directors"); comboBoxVersion.Items.Add("Extended"); comboBoxVersion.Items.Add("Theater"); comboBoxVersion.Items.Add("Unrated"); comboBoxCodec.Items.Clear(); comboBoxCodec.Items.Add("h264"); comboBoxSource.Items.Clear(); comboBoxSource.Items.Add("Bluray"); comboBoxSource.Items.Add("DVD"); comboBoxSource.Items.Add("Stream"); comboBoxMPAA.DropDownStyle = ComboBoxStyle.DropDown; comboBoxMPAA.Items.Clear(); comboBoxMPAA.Items.Add("G"); comboBoxMPAA.Items.Add("PG"); comboBoxMPAA.Items.Add("PG-13"); comboBoxMPAA.Items.Add("R"); comboBoxMPAA.Items.Add("NC-17"); comboBoxMPAA.SelectedIndex = 0; linkLabelBing.LinkBehavior = LinkBehavior.HoverUnderline; linkLabelBing.LinkVisited = false; linkLabelBing.LinkColor = Color.Gray; linkLabelBing.Text = "Bing"; linkLabelGoogle.LinkBehavior = LinkBehavior.HoverUnderline; linkLabelGoogle.LinkVisited = false; linkLabelGoogle.LinkColor = Color.Gray; linkLabelGoogle.Text = "Google"; linkLabelRT.LinkBehavior = LinkBehavior.HoverUnderline; linkLabelRT.LinkVisited = false; linkLabelRT.LinkColor = Color.Gray; linkLabelRT.Text = "RT"; linkLabelIMDB.LinkBehavior = LinkBehavior.HoverUnderline; linkLabelIMDB.LinkVisited = false; linkLabelIMDB.LinkColor = Color.Gray; linkLabelIMDB.Text = "IMDB"; linkLabelTMDB.LinkBehavior = LinkBehavior.HoverUnderline; linkLabelTMDB.LinkVisited = false; linkLabelTMDB.LinkColor = Color.Gray; linkLabelTMDB.Text = "TMDB"; checkBoxWatched.Checked = false; dataGridViewActors.Columns[1].Width = 100; // role dataGridViewActors.Columns[0].Width = dataGridViewActors.Width - dataGridViewActors.Columns[1].Width - MyDPI.ScaleDPIDimension(5); // name // match higlights of form fields (textboxes, comboboxes, etc) via MyFormField.HighlightFormFieldsOnFocus() dataGridViewActors.RowTemplate.DefaultCellStyle.SelectionBackColor = Color.LightYellow; dataGridViewActors.RowTemplate.DefaultCellStyle.SelectionForeColor = Color.Black; dataGridViewGenres.RowTemplate.DefaultCellStyle.SelectionBackColor = Color.LightYellow; dataGridViewGenres.RowTemplate.DefaultCellStyle.SelectionForeColor = Color.Black; dataGridViewTags.RowTemplate.DefaultCellStyle.SelectionBackColor = Color.LightYellow; dataGridViewTags.RowTemplate.DefaultCellStyle.SelectionForeColor = Color.Black; VideoInfo videoInfo = new VideoInfo(); videoInfo.videoItem = new VideoItem(); SetForm(videoInfo); DisableFormButtons(); MyTooltip tooltip = new MyTooltip(); //tooltip.SetToolTip((LinkLabel)sender, "test test"); }