Plz send the working code of word wrap in notepad,the present situation is enabled the word wrap option but not working properly
im using this code listed below.........
CODE:::::::::::::::
private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e)
{
if (wordWrapToolStripMenuItem.Checked == false)
{
wordWrapToolStripMenuItem.Checked = true;
richTextBox1.WordWrap = true;
}
else
{
wordWrapToolStripMenuItem.Checked = false;
richTextBox1.WordWrap = false;
}
}
5 replies to this topic
#1
Posted 11 February 2011 - 07:54 AM
|
|
|
#2
Posted 11 February 2011 - 09:29 AM
You need to make sure your richTextBox property "CheckOnClick" is set to true, that way the wordwrap can turn off.
This code will work fine:
This code will work fine:
if (wordWrapToolStripMenuItem.Checked == true)
{
richTextBox1.WordWrap = true;
}
else { richTextBox1.WordWrap = false; }
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#3
Posted 11 February 2011 - 09:34 AM
not sure what it is your trying to do, but you're doing it long hand.. =)
would be much cleaner...
private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e)
{
wordWrapToolStripMenuItem.Checked = !wordWrapToolStripMenuItem.Checked;
richTextBox1.WordWrap = richTextBox1.WordWrap;
}
would be much cleaner...
#4
Posted 11 February 2011 - 09:35 AM
that was in response to original post, not you committed =)
#5
Posted 11 February 2011 - 09:42 AM
Quote
that was in response to original post, not you committed =)
Nice solution! Something I never would of thought of. ~ Committed. :)
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#6
Posted 11 February 2011 - 10:33 AM
wait, hold on, I posted an obvious bug, wasnt paying attention...
=)
private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e)
{
wordWrapToolStripMenuItem.Checked = !wordWrapToolStripMenuItem.Checked;
richTextBox1.WordWrap = wordWrapToolStripMenuItem.Checked;
}
=)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









