-
July 1st, 2004, 04:04 AM
#1
Form.Text = ""; makes the Form disappear
I call the MyForm's ShowDialog. The window appears for less than 1/2 second then disappears, and I don't know why.
Code:
private void MyForm_Load(object sender, System.EventArgs e)
{
Text = "";
}
If I change the lines above into the following, the problem no longer occurs.
Code:
private void MyForm_Load(object sender, System.EventArgs e)
{
Text = " ";
}
Why this? I thought I could empty Text without any trouble.
Mr. Burns
-
July 2nd, 2004, 06:56 AM
#2
Mr. Burns,
what is Text?
edit: mah mistake... didnt read it well...
did you try string.empty?
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
-
July 2nd, 2004, 07:19 AM
#3
Text is a string member of Form class. When you open a Form you can use this member to write something in the title bar.
No, I haven't tried with string.Empty. What I want is to know what is wrong in my code (the problem is already solved filling Text with " ").
Thank you Andy.
Mr. Burns
-
July 3rd, 2004, 10:38 AM
#4
as far as i can see, it is the same thing if you work with cookies in PHP...
setcookie (name, value);
is a global function, if you want to set a cookie you write a value, if a value doesnt exist (setcookie(name)) -- the cookie with that name will be deleted.. i believe its how it works, so there shouldnt be anything wrong with your code..
Regards,
Alexei
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|