473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

strange resize problems using inherited VB.NET forms

I am getting strange resizing problems when using an inherited form.

Controls are moving themselves seemingly randomly, but reproducibly.

"frmBase" is my base class (a windows form), and contains a few controls
anchored to the sides of the form.

"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I place
addition controls on the "frmChild" form. When I rebuild the project, the
original base controls move to new locations (often off the bounds of the
form). If I remove the new controls to the child class and then rebuild,
violia, the original base control's snap back to the correct locations!!

What in the heck is going on here? It seems that I can't use inherited
forms for this reason... but I really want too.

- Peter
PS. Version 7.1.3088
Nov 20 '05 #1
8 6655

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
I am getting strange resizing problems when using an inherited form.

Controls are moving themselves seemingly randomly, but reproducibly.

"frmBase" is my base class (a windows form), and contains a few controls
anchored to the sides of the form.

"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I place
addition controls on the "frmChild" form. When I rebuild the project, the
original base controls move to new locations (often off the bounds of the
form). If I remove the new controls to the child class and then rebuild,
violia, the original base control's snap back to the correct locations!!

What in the heck is going on here? It seems that I can't use inherited
forms for this reason... but I really want too.

- Peter
PS. Version 7.1.3088


To answer my own question (a least a little bit)...

It looks like a serious error with the anchor property on the inherited
form... unless I'm missing something pretty obvious?

- Peter
Nov 20 '05 #2
"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
I am getting strange resizing problems when using an inherited form.

Controls are moving themselves seemingly randomly, but reproducibly.

"frmBase" is my base class (a windows form), and contains a few controls
anchored to the sides of the form.

"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I place addition controls on the "frmChild" form. When I rebuild the project, the original base controls move to new locations (often off the bounds of the form). If I remove the new controls to the child class and then rebuild,
violia, the original base control's snap back to the correct locations!!

What in the heck is going on here? It seems that I can't use inherited
forms for this reason... but I really want too.

- Peter
PS. Version 7.1.3088


To answer my own question (a least a little bit)...

It looks like a serious error with the anchor property on the inherited
form... unless I'm missing something pretty obvious?

- Peter

Ok... another update. The problem appears when the base classes control's
have their modifier properties set to Friend (which should be ok... but
isn't for some reason). I change their modifer properties to Public and the
problem stopped.

It's not an ideal, and would still like to hear why this is so. The Help
file cautions Inheritors, but I don't fully understand if this applies in my
case.

- Peter
Nov 20 '05 #3
"Spam Trap" <sp**@midar.com> wrote in message
news:40**********************@news.optusnet.com.au ...
"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
I am getting strange resizing problems when using an inherited form.

Controls are moving themselves seemingly randomly, but reproducibly.

"frmBase" is my base class (a windows form), and contains a few controls anchored to the sides of the form.

"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I place addition controls on the "frmChild" form. When I rebuild the project, the original base controls move to new locations (often off the bounds of the form). If I remove the new controls to the child class and then rebuild, violia, the original base control's snap back to the correct locations!!
What in the heck is going on here? It seems that I can't use inherited forms for this reason... but I really want too.

- Peter
PS. Version 7.1.3088
To answer my own question (a least a little bit)...

It looks like a serious error with the anchor property on the inherited
form... unless I'm missing something pretty obvious?

- Peter

Ok... another update. The problem appears when the base classes control's
have their modifier properties set to Friend (which should be ok... but
isn't for some reason). I change their modifer properties to Public and

the problem stopped.

It's not an ideal, and would still like to hear why this is so. The Help
file cautions Inheritors, but I don't fully understand if this applies in my case.

- Peter


Ok... back to my original point. Does anyone know of a fix.

I've come to the conclusion that inherited forms with controls that are
archored are the BUGGIEST things on Earth!

BUG BUG BUG BUG BUG.... please... someone proove me wrong? Can anyone at
least find a KB article on this - I can't.

- Peter
Nov 20 '05 #4
Hello Peter

I created a Base class called frmBase and placed 2 text boxes
and one combo on it

I anchored them left.top,right

I created a child form called frmChild and inherited from
frmBase. I them placed 2 textboxes and one datagrid on the form. I anchored
them top and right

I ran the project. Sizing worked just fine and nothing moved
abnormally that I could tell.

I am also running 7.1.3088 on Win2k

Can you give a more precise example?


--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
I am getting strange resizing problems when using an inherited form.

Controls are moving themselves seemingly randomly, but reproducibly.

"frmBase" is my base class (a windows form), and contains a few controls
anchored to the sides of the form.

"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I place
addition controls on the "frmChild" form. When I rebuild the project, the
original base controls move to new locations (often off the bounds of the
form). If I remove the new controls to the child class and then rebuild,
violia, the original base control's snap back to the correct locations!!

What in the heck is going on here? It seems that I can't use inherited
forms for this reason... but I really want too.

- Peter
PS. Version 7.1.3088

Nov 20 '05 #5
thank you for taking the time to examine my problem. Yes, this is a strange
one. If you do things in a nice neat order, then there is no problem. The
problems start to occur when you move or remove controls on the inherited
form. And let's face it... you're always fiddling with form to get them
looking just right. Try archoring a button bottom-right on the base class,
then placing a groupbox onto the child form that is anchored to all sides.
Now... when you rebuild the project, the original buttons location has
changed for no reason.

What is causing this bizzare behaviour??

Thank you in advance.

- Peter
"IbrahimMalluf" <Ib*****@malluf.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
Hello Peter

I created a Base class called frmBase and placed 2 text boxes
and one combo on it

I anchored them left.top,right

I created a child form called frmChild and inherited from
frmBase. I them placed 2 textboxes and one datagrid on the form. I anchored them top and right

I ran the project. Sizing worked just fine and nothing moved
abnormally that I could tell.

I am also running 7.1.3088 on Win2k

Can you give a more precise example?


--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
I am getting strange resizing problems when using an inherited form.

Controls are moving themselves seemingly randomly, but reproducibly.

"frmBase" is my base class (a windows form), and contains a few controls
anchored to the sides of the form.

"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I place addition controls on the "frmChild" form. When I rebuild the project, the original base controls move to new locations (often off the bounds of the form). If I remove the new controls to the child class and then rebuild,
violia, the original base control's snap back to the correct locations!!

What in the heck is going on here? It seems that I can't use inherited
forms for this reason... but I really want too.

- Peter
PS. Version 7.1.3088


Nov 20 '05 #6
If I remark out the following line of code...
Me.SuspendLayout()

....from the inherited form, then the next time the screen is
refreshed/drawn, it is drawn properly without errors. However, VB.NET resets
this line of code.

There seems to be a bug in this area... unless I'm missing something (and I
still think I am?)

- Peter

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
thank you for taking the time to examine my problem. Yes, this is a strange one. If you do things in a nice neat order, then there is no problem. The
problems start to occur when you move or remove controls on the inherited
form. And let's face it... you're always fiddling with form to get them
looking just right. Try archoring a button bottom-right on the base class,
then placing a groupbox onto the child form that is anchored to all sides.
Now... when you rebuild the project, the original buttons location has
changed for no reason.

What is causing this bizzare behaviour??

Thank you in advance.

- Peter
"IbrahimMalluf" <Ib*****@malluf.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
Hello Peter

I created a Base class called frmBase and placed 2 text boxes
and one combo on it

I anchored them left.top,right

I created a child form called frmChild and inherited from
frmBase. I them placed 2 textboxes and one datagrid on the form. I

anchored
them top and right

I ran the project. Sizing worked just fine and nothing moved abnormally that I could tell.

I am also running 7.1.3088 on Win2k

Can you give a more precise example?


--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
I am getting strange resizing problems when using an inherited form.

Controls are moving themselves seemingly randomly, but reproducibly.

"frmBase" is my base class (a windows form), and contains a few controls anchored to the sides of the form.

"frmChild" inherits from "frmBase"... and the controls appear on the
inherited form as expected. However things start going wrong when I

place addition controls on the "frmChild" form. When I rebuild the project, the original base controls move to new locations (often off the bounds of the form). If I remove the new controls to the child class and then rebuild, violia, the original base control's snap back to the correct locations!!
What in the heck is going on here? It seems that I can't use inherited forms for this reason... but I really want too.

- Peter
PS. Version 7.1.3088



Nov 20 '05 #7
Found this... although I can't promise it's accurate. Looks like the author
of the article needs to do more testing.

Microsoft Knowledge Base Article - 316560
FIX: Anchored Control on Inherited Form Changes Location When You Recompile
http://support.microsoft.com/default...b;en-us;316560

They claim this is a fix... but it isn't. I still have the problem in .NET
1.1.4322

This makes me mad! Crappy code. The "fix" (if you can call it a fix) is
NEVER to resize your forms. Not in design time - or run time! Crazy!

- Peter
PS. I have spent over 18 hours on this problem... and enough is enough.
VB.NET inherited forms that use anchored controls on the base class are
simply buggy. Microsoft has not given a commitment to fix the problem, and
their acknowledgement via KB article seems to suggest they have fixed it,
when really the have not. I have contact them via e-mail about this
problem... but I have no idea if this will fall on deaf ears.
"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
If I remark out the following line of code...
Me.SuspendLayout()

...from the inherited form, then the next time the screen is
refreshed/drawn, it is drawn properly without errors. However, VB.NET resets this line of code.

There seems to be a bug in this area... unless I'm missing something (and I still think I am?)

- Peter

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
thank you for taking the time to examine my problem. Yes, this is a

strange
one. If you do things in a nice neat order, then there is no problem. The
problems start to occur when you move or remove controls on the inherited form. And let's face it... you're always fiddling with form to get them
looking just right. Try archoring a button bottom-right on the base class, then placing a groupbox onto the child form that is anchored to all sides. Now... when you rebuild the project, the original buttons location has
changed for no reason.

What is causing this bizzare behaviour??

Thank you in advance.

- Peter
"IbrahimMalluf" <Ib*****@malluf.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
Hello Peter

I created a Base class called frmBase and placed 2 text boxes and one combo on it

I anchored them left.top,right

I created a child form called frmChild and inherited from
frmBase. I them placed 2 textboxes and one datagrid on the form. I

anchored
them top and right

I ran the project. Sizing worked just fine and nothing moved abnormally that I could tell.

I am also running 7.1.3088 on Win2k

Can you give a more precise example?


--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx

"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
> I am getting strange resizing problems when using an inherited form.
>
> Controls are moving themselves seemingly randomly, but reproducibly.
>
> "frmBase" is my base class (a windows form), and contains a few controls > anchored to the sides of the form.
>
> "frmChild" inherits from "frmBase"... and the controls appear on the
> inherited form as expected. However things start going wrong when I

place
> addition controls on the "frmChild" form. When I rebuild the
project, the
> original base controls move to new locations (often off the bounds
of the
> form). If I remove the new controls to the child class and then

rebuild, > violia, the original base control's snap back to the correct locations!! >
> What in the heck is going on here? It seems that I can't use inherited > forms for this reason... but I really want too.
>
> - Peter
> PS. Version 7.1.3088
>
>



Nov 20 '05 #8
jon
I'm having a similar problem

I'm not inheriting the forms, though. I've created a simple form and everything was fine until I copied and pasted it into the same project to start another similar form. Now the form doesn't save its dimensions properly. When I save and close visual studio and then reopen, the form changes it's size and the buttons move around. I've unselected all of the anchors from the buttons and it still does it. If I resize the form at design time, the buttons are moving up and down the form at about one half the distance that I am resizing the bottom of the form

This is weird and I really haven't been able to find any mention of the problem elsewhere.
Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
I have created an MDI child form that I am using as a base form in a VB.Net MDI application. The base MDI child form has a series of menu options on it. I then use this form to create other MDI...
0
by: Nick Zdunic | last post by:
Hi, I have some forms in my application. Some visually inherited forms resize themselves in Visual Studio - ruuning my previous settings. Locking the form has no effect either. The forms it...
0
by: Mauro | last post by:
Hi, I need a big help to resolve this problem. I need to put a usercontrol in a datagrid: this control check if the code inserted is present in a archive and if not return a error message. (In...
6
by: Ty Salistean | last post by:
I have a form that I inherited from System.Windows.Forms. I use that form everywhere in my system. I went back to my base class form and changed the size, expecting all of my children forms to...
2
by: | last post by:
Let me explain step wise. 1.. I have a site running on port 5555 2.. If contains web.config file with contains <Forms> authentication. 3.. The site contains a sub-folder named "MembersArea"...
2
by: Peter Proost | last post by:
Hi group I have the following piece of code that should resize the bitmap in a picture box but it doesn't work as I tought it would. Can someone help me with it? thnx Peter Public Class...
1
by: Geroge D. Lake | last post by:
Hi, I need to disable the resizing of a datagrid. I have tried al day and no luck. Any Ideas? Thanks. George.
5
by: gilgames | last post by:
I am new in VB.Net, I need some help. I want to resize my dialogs dynamically (so that a dialog made for 1280x1024 screens shows properly on 800x640 screen. I make the calculation in the Handles...
6
by: Rob | last post by:
I need to create a form that will resize only the verticle size of the Form and not the width. So far I'm partial to the following code. Can someone please elaborate the ??? . . . . Const...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.