Form Elements gone from view?

Dec 13, 2007 at 4:45 AM
I created a simple form, added a tab control and had set up the layout of my form in pretty much the manner I desired. I attempted to debug it to see how it would look (see my other post for the errors I got) and now my form is empty. All of my fields seem to be defined in the code, but I don't see them in the form designer. Any ideas?

-Pete
Jan 11, 2008 at 2:04 AM
Did you find out what was going on with this blank form? I have something similar. The code executes and the real form is displayed at runtime, but the form designer continues to just show a blank form. I get no errors so I have no idea where to even start debugging the problem.

Ken
Jan 11, 2008 at 3:00 AM

ktrudgeon wrote:
Did you find out what was going on with this blank form? I have something similar. The code executes and the real form is displayed at runtime, but the form designer continues to just show a blank form. I get no errors so I have no idea where to even start debugging the problem.

Ken


I couldn't even get the code to run. I ended up tracking down every instance of IronPython DLL's on my system and replacing them with the version IP Studio expected. That still didn't fix my form issues so I started over, but really didn't have time to mess with anything after that point. At least I can seemingly get things to run/compile now. I don't know if I'll still have issues going forward, but I'll wire up some more controls soon and give it another try. I've got a couple of skunkworks apps I need to put together.

-Pete
Jan 11, 2008 at 3:34 PM
Thanks for the update Pete. My experience so far seems to indicate that the form designer is very brittle. It seems it is best to not manually edit the form code at all, but just farm out events to code outside of the main form.

Ken
Mar 14, 2008 at 3:11 PM


paschott wrote:
I created a simple form, added a tab control and had set up the layout of my form in pretty much the manner I desired. I attempted to debug it to see how it would look (see my other post for the errors I got) and now my form is empty. All of my fields seem to be defined in the code, but I don't see them in the form designer. Any ideas?

-Pete


Hi Pete. The exact same thing happened to me and here is what I discovered the problem was: I had elements with negative coordinates in their location. The second I changed my textbox to have a negative coordinates, the entire form went blank, as you described. As soon as I changed the negative coordinate to zero, all the form elements reappeared.

Specifically: I changed

self._textBox1.Location = System.Drawing.Point(-2, 56)

to

self._textBox1.Location = System.Drawing.Point(0, 56)

My guess is that when you put your tab control in, you tried to anchor it to the side of the window but instead of explicitly setting its upper-left corner to (0,0), you tried to eyeball it. I bet this gave you a negative coordinate and wiped your form. If you still have the code, I bet zeroing all negative coordinates will restore your form in the form designer.
Mar 14, 2008 at 4:40 PM
Sadly, I don't think I have that code anymore. I was moving stuff around by hand - definitely not touching the properties. It's quite possible that I somehow got a negative coordinate in the original code.

I've been a little out of the loop lately anyway. I want to play around with this more and build a useful app or two, but just haven't really had a chance yet. If this comes up again, I'll check my coordinates behind the scenes for negative numbers.

Thank you for following up after so much time since the original post.

-Pete