Form properties resetting themselves
-
Help, Im going insane. Im using VS.Net 2005 and have come across a problem where properties I set dont seem to take affect. For example: I have a vb.net form, I set its size to 330, 500. Save the form. Close and reopen it, and the size has changed to 326, 497. Ive done it 20 times. Even rebooted several times. The form isnt locked. The file is writeable. Infact, the actual size in the designer does even match, in there it says 324, 469. So I manually change that value to 330, 500. Save, close and reopen. Now my form has grown to 332, 528!! Here's what the designer says:
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.SystemColors.Control Me.ClientSize = New System.Drawing.Size(324, 469)
As you can see, nothing fancy at all. I changed the colour to bright red. saved, closed, reopened. The form was still bright red. Has anyone ever seen this happen before? Not happening anywhere else, other forms seem to be fine. However it has reminded me of a problem last week, where I had a splitter on a form, which I moved, and later noticed that it had repositioned itself. Im lost. And slowly going crazy! Please help!! Mark -
Help, Im going insane. Im using VS.Net 2005 and have come across a problem where properties I set dont seem to take affect. For example: I have a vb.net form, I set its size to 330, 500. Save the form. Close and reopen it, and the size has changed to 326, 497. Ive done it 20 times. Even rebooted several times. The form isnt locked. The file is writeable. Infact, the actual size in the designer does even match, in there it says 324, 469. So I manually change that value to 330, 500. Save, close and reopen. Now my form has grown to 332, 528!! Here's what the designer says:
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.SystemColors.Control Me.ClientSize = New System.Drawing.Size(324, 469)
As you can see, nothing fancy at all. I changed the colour to bright red. saved, closed, reopened. The form was still bright red. Has anyone ever seen this happen before? Not happening anywhere else, other forms seem to be fine. However it has reminded me of a problem last week, where I had a splitter on a form, which I moved, and later noticed that it had repositioned itself. Im lost. And slowly going crazy! Please help!! MarkDo you set it in the designer, or in code ? If in code, before or after the initialiseComponent call ?
-
Do you set it in the designer, or in code ? If in code, before or after the initialiseComponent call ?