Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Buttons in a dialog box move after closing and reopening designer.

$
0
0

I am working with VS2013, .Net 4.0 and C#.  I have several simple dialog boxes with a label, progress bar, multi-line textbox and a button.  I move the objects around in designer and things appear as I desire.  I close the designer window and reopen the same dialog in designer and the button has moves such that it is partially hidden by the text box.  A hint may be that other dialogs without a multiline text box do not seem to have this problem.

Initially designer looks like:

After closing and immediately reopening I get the abort button partially obscured.:

The dialog is inherited from Form.  Changing the anchor attribute does not help.

I am almost to the point of placing the button programmatically in the dialog constructor, but that leaves the next developer stupified on why changing designer does not move the button.

I have changed many layout attributes without getting the expected placement of the button after closing and reopening.

The button pertainent code is below:

            this.buttonAbort = new System.Windows.Forms.Button();
            this.progressBar1 = new System.Windows.Forms.ProgressBar();
            this.label1 = new System.Windows.Forms.Label();
            this.timerDiscovery = new System.Windows.Forms.Timer(this.components);
            this.textBox = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            // 
            // buttonAbort
            // 
            this.buttonAbort.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.buttonAbort.Location = new System.Drawing.Point(299, 404);
            this.buttonAbort.Margin = new System.Windows.Forms.Padding(6);
            this.buttonAbort.Name = "buttonAbort";
            this.buttonAbort.Size = new System.Drawing.Size(137, 43);
            this.buttonAbort.TabIndex = 0;
            this.buttonAbort.Text = "&Abort";
            this.buttonAbort.UseVisualStyleBackColor = true;
            this.buttonAbort.Click += new System.EventHandler(this.buttonCancel_Click);

What do I need to do to get designer to stop moving this button around 'for' me?


J. W. Osen, Ph.D.


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>