4 Replies - 561 Views - Last Post: 21 February 2015 - 01:10 PM Rate Topic: -----

#1 November-06   User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

Controls in the Windows Form won't show

Posted 21 February 2015 - 12:27 PM

I created a simple calculator in Win App. When I played it, the form is displayed blank. Not a single control is shown.

The only thing I've done differently is adding a Coded UI Test in my test project. This is the first time I'm going to try to add a coded UI test so I wonder if that's the cause for this.

Anyone who has encountered this before?
Is This A Good Question/Topic? 0
  • +

Replies To: Controls in the Windows Form won't show

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14925
  • View blog
  • Posts: 59,591
  • Joined: 12-June 08

Re: Controls in the Windows Form won't show

Posted 21 February 2015 - 12:31 PM

That could be a whole mess of things, and you need to explain more.

What does the code look like?
Is there something interrupting the designer?
etc.
Was This Post Helpful? 0
  • +
  • -

#3 November-06   User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

Re: Controls in the Windows Form won't show

Posted 21 February 2015 - 12:52 PM

I didn't modify the Program.cs

In my Form constructor, all I did was set default values for my global variables.

Since it's a simple calculator, the controls involve buttons for numbers and simple operations like addition, subtraction, multiplication, division and equals.

I couldn't find the coded UI test when I created the project in VS 2010 Premium. So, before I created the calculator, I added a test project first to see if I have a coded UI test in my VS version.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14925
  • View blog
  • Posts: 59,591
  • Joined: 12-June 08

Re: Controls in the Windows Form won't show

Posted 21 February 2015 - 12:53 PM

Okay.. make a second project. Copy the designer code over to it.. see if that works.
Was This Post Helpful? 1
  • +
  • -

#5 November-06   User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

Re: Controls in the Windows Form won't show

Posted 21 February 2015 - 01:10 PM

Thanks. I got it. It was a simple mistake actually that I overlooked.

When I set the default values in the constructor, I forgot that I removed the InitializeComponent()

I got used to coding in web forms that I overlooked that one.

Sorry and thanks again.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1