Solved

Check my code out(2)

Posted on 2016-11-19
1
24 Views
Last Modified: 2016-12-01
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;
            ReadOnlyButton.Enabled = false;
            ReadOnlyButton.BackColor = Color.Black;
            ReadOnlyButton.ForeColor = Color.White;
            Mainbutton.Enabled = true;
            Mainbutton.BackColor = Color.Black;
            Mainbutton.ForeColor = Color.White;
            textBox1.BackColor = Color.Black;
            textBox1.ForeColor = Color.White;
            textBox1.ReadOnly = false;
            fa.Text = ",";
           




        }

        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();
           if (textBox1.Text==textBox1.Text+"I want to make a new file")
            {
               
            }
           
            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;
            }
            if (textBox1.Text == textBox1.Text + "Cursors = Hand")
            {
                fa.Cursor = Cursors.Hand;
            }
            if (textBox1.Text == textBox1.Text +"Cursors = UpArrow")
            {
                fa.Cursor = Cursors.UpArrow;
            }
            if (textBox1.Text == textBox1.Text + "Return to original Properties(2)")
            {
                fa.Cursor = Cursors.Arrow;
            }
            if (textBox1.Text == textBox1.Text +"Go away I dont need you anymore")
            {
                textBox1.ReadOnly = true;
                Mainbutton.Enabled = false;
                ReadOnlyButton.Enabled = true;
               
            }
           

        }

        private void ReadOnlyButton_Click(object sender, EventArgs e)
        {
            ReadOnlyButton.Enabled = false;
            textBox1.ReadOnly = false;
            Mainbutton.Enabled = true;

        }
    }
}
but if I don't use FormA  fa = new FormA()

its all wrong
0
Comment
Question by:Brian Smith
1 Comment
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
Comment Utility
>>but if I don't use FormA  fa = new FormA()   its all wrong

As I pointed out in your earlier question that is creating an endless loop which blows the stack up - so it WRONG

What you might want is to use this. to refer to the current instance of the form.  But you don't say what you want so my guess could be not what you want either.
0

Featured Post

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!

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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