Note that there are some explanatory texts on larger screens.

plurals
  1. POLabels doesnt work on Visual Studio 2010
    primarykey
    data
    text
    <p>Im using Visual Studio 2010 Ultimate and Im trying to convert some images using a progress bar and two labels but the text of both labels is not shown and the program just shows the labels with white background.</p> <p><img src="https://i.stack.imgur.com/31bXk.jpg" alt="enter image description here"></p> <p>p.s. The labels backcolor is "Control" (not transparent)</p> <p>I have two forms 1st the "Main" form and the "ProgressDialog" form</p> <p>in the main form when I click my "Save" button</p> <pre><code>//copy the filenames to a new array to sort them string[] FileNames = openDialog.FileNames; Array.Sort(FileNames); //create an instance of my progress dialog ProgressDialog progress = new ProgressDialog(this, 100/FileNames.Length); progress.ShowProgress(); //save all the files in the array for (int i = 0; i &lt; FileNames.Length; i++) { //call the SaveImage method SaveImage(FileNames[i], 597, 412, Fill); //increase the progresbar and set the label text of the progress dialog to the filename progress.Increase(FileNames[i]); } progress.Close();//close progress dialog and re-enable the main form </code></pre> <p>...and here the code of my "ProgressDialog" form:</p> <p>Bar: name of the progress bar</p> <p>Comment: name of the label with the image path as text</p> <pre><code>private Form SenderForm;// the "Main" form private int Step; //value to increase in the progress bar public ProgressDialog(Form sender, int step)//constructor { InitializeComponent(); SenderForm = sender; Step = step; } //disable cose button private const int CP_NOCLOSE_BUTTON = 0x200; protected override CreateParams CreateParams { get { CreateParams myCp = base.CreateParams; myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON; return myCp; } } //re-enable the "Main" form private void ProgressDialog_FormClosed(object sender, FormClosedEventArgs e) { SenderForm.Enabled = true; SenderForm.Activate();//activate form } //increase the value of the progressbar public void Increase( string comment=null, int step=0) { //if step is 0 -&gt; use the Step of the constructor if (step==0) step = Step; //if the comment (the current file name) is != of null if (comment!=null) Comment.Text = comment;//use the comment of the parameter //increase progressbar Bar.Value += step; } //show "ProgrssDialog" form public void ShowProgress() { this.Show(); SenderForm.Enabled = false;//disable the main form } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload