0

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?

Edited by mbob61: n/a

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by kordaff
0

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

Mike

0

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.

Edited by nick.crane: n/a

0

Can this be triggered with a checkboxs .Checked property?

Mike

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.