@@ -169,33 +169,14 @@ private void RefreshDrives()
169169 }
170170 }
171171
172- if ( comboBoxDrive . Items . Count == 0 )
173- {
174- comboBoxDrive . Visible = false ;
175- cdChanger1 . Visible = false ;
176- labelSingleDvd . Visible = false ;
177- linkLabelEject . Visible = false ;
178- newCDLabel . Visible = VM != null && ! VM . is_control_domain ;
179-
180- }
181- else if ( comboBoxDrive . Items . Count == 1 )
182- {
183- comboBoxDrive . Visible = false ;
184- cdChanger1 . Visible = true ;
172+ labelSingleDvd . Visible = comboBoxDrive . Items . Count == 1 ;
173+ if ( labelSingleDvd . Visible )
185174 labelSingleDvd . Text = comboBoxDrive . Items [ 0 ] . ToString ( ) ;
186- labelSingleDvd . Visible = true ;
187- tableLayoutPanel1 . ColumnStyles [ 0 ] . Width = labelSingleDvd . Width ;
188- newCDLabel . Visible = false ;
189- linkLabelEject . Visible = true ;
190- }
191- else
192- {
193- comboBoxDrive . Visible = true ;
194- cdChanger1 . Visible = true ;
195- labelSingleDvd . Visible = false ;
196- newCDLabel . Visible = false ;
197- linkLabelEject . Visible = true ;
198- }
175+
176+ comboBoxDrive . Visible = comboBoxDrive . Items . Count > 1 ;
177+ cdChanger1 . Visible = comboBoxDrive . Items . Count > 0 ;
178+ linkLabelEject . Visible = comboBoxDrive . Items . Count > 0 ;
179+ newCDLabel . Visible = comboBoxDrive . Items . Count == 0 && VM != null && ! VM . is_control_domain ;
199180
200181 _inRefresh = false ;
201182
0 commit comments