Check my code out

Posted on 2016-11-18
6
32 Views
Last Modified: 2016-12-02
when I'm trying to debug this something happenes with cs.Designer

can someone help me?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Gallowey_Cute
{
    public partial class FormA : Form
    {
        public FormA()
        {
            InitializeComponent();
            FormA fa = new FormA();
            fa.StartPosition = FormStartPosition.CenterScreen;
            fa.WindowState = new FormWindowState();
            fa.WindowState = FormWindowState.Normal;
            fa.Cursor = Cursors.Arrow;
            fa.MaximizeBox = true;
            fa.MinimizeBox = true;
            fa.Visible = true;
            fa.Enabled = true;
            fa.BackColor = Color.Black;
            
            
                
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            textBox1.BackColor = Color.Black;
            textBox1.ForeColor = Color.White;
        }

        private void Mainbutton_Click(object sender, EventArgs e)
        {
            FormA fa = new FormA();
            Mainbutton.BackColor = Color.Black;
            Mainbutton.ForeColor = Color.White;
            if (textBox1.Text == textBox1.Text + "Maximize form = false;") 
            {
                fa.MaximizeBox = false;
            }
            if (textBox1.Text == textBox1.Text + "Minimize form = false;")
            {
                fa.MinimizeBox = false;
            }
            if (textBox1.Text == textBox1.Text + "Return to original Properties(0)")
            {
                fa.MaximizeBox = true;
                fa.MinimizeBox = true;
            }
            if (textBox1.Text == textBox1.Text + "Form Window State = Maximized")
            {
                fa.WindowState = FormWindowState.Maximized;
            }
            if (textBox1.Text == textBox1.Text +"Form Window State = Minimized")
            {
                fa.WindowState = FormWindowState.Minimized;
            }
            if (textBox1.Text == textBox1.Text +"Return to original Properties(1)")
            {
                fa.WindowState = FormWindowState.Normal;
            }

        }
    }
}

Open in new window

0
Comment
Question by:Brian Smith
  • 2
  • 2
6 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
Comment Utility
What happens to the designer?
0
 
LVL 16

Expert Comment

by:Pawan Kumar Khowal
Comment Utility
Are you facing any issues here ?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
Nothing I see about designer but:

       public FormA()
        {
            InitializeComponent();

//Create new instance of form A and modify some properties - not the current one
//This will result in this code being called for the new instance which creates yet aanother instance
//which runs this code and creates another instance
//and again
//and again
//until BOOOOOM - your stack is blown
            FormA fa = new FormA();
            fa.StartPosition = FormStartPosition.CenterScreen;
            fa.WindowState = new FormWindowState();
            fa.WindowState = FormWindowState.Normal;
            fa.Cursor = Cursors.Arrow;
            fa.MaximizeBox = true;
            fa.MinimizeBox = true;
            fa.Visible = true;
            fa.Enabled = true;
            fa.BackColor = Color.Black;
           
           
               
        }
0
 
LVL 62

Expert Comment

by:Fernando Soto
Comment Utility
Update please.
0
 
LVL 16

Expert Comment

by:Pawan Kumar Khowal
Comment Utility
I dont know what help you got from the answer you selected. Can you explain?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now