is it possible to make the title property of the form itself visible or invisible via the use of a checkbox?
I'm rather new to C# so i'm not sure how much of a stupid question this is :P
Thanks for reading.

Mike

Edit:

I'm currently using..
this.Text = string.Empty;

Is it possible to make this work into the checked code?

Recommended Answers

All 4 Replies

by checked code, I meant making it work with the .Checked line.
An example would be programmerNameLabel.Visible = hideProgrammerCheckBox.Checked;

Mike

To remove a form's title bar you need to set the Form.Text property to string.Empty and set the Form.ControlBox property to false.
Note: This also means there is no X close button, so make sure you have another way to close the form.

Can this be triggered with a checkboxs .Checked property?

Mike

Attach your checkbox's CheckChanged event to the method below.

private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                this.Text = string.Empty;
                this.ControlBox = false;
            }
            else
            {
                this.Text = "Title On";
                this.ControlBox = true;
            }
        }

Kordaff

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.