Click here to Skip to main content
15,898,939 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get actual IP address of the computer? Pin
S. Senthil Kumar14-Jan-09 22:18
S. Senthil Kumar14-Jan-09 22:18 
GeneralRe: How to get actual IP address of the computer? Pin
MAP Tiger15-Jan-09 6:56
MAP Tiger15-Jan-09 6:56 
QuestionCollecting values from datagridview.selectedrows[0].cells Pin
Lodeclaw14-Jan-09 11:21
Lodeclaw14-Jan-09 11:21 
AnswerRe: Collecting values from datagridview.selectedrows[0].cells Pin
Cassandra Ross14-Jan-09 11:33
Cassandra Ross14-Jan-09 11:33 
GeneralRe: Collecting values from datagridview.selectedrows[0].cells Pin
Lodeclaw14-Jan-09 11:45
Lodeclaw14-Jan-09 11:45 
GeneralRe: Collecting values from datagridview.selectedrows[0].cells Pin
Cassandra Ross14-Jan-09 12:07
Cassandra Ross14-Jan-09 12:07 
GeneralRe: Collecting values from datagridview.selectedrows[0].cells Pin
Lodeclaw14-Jan-09 12:19
Lodeclaw14-Jan-09 12:19 
QuestionGetting ToolStrip button's CheckState to reflect RichTextBox content Pin
Member 263050314-Jan-09 10:32
Member 263050314-Jan-09 10:32 
Dear Sirs:
I have a C# application with a ToolStrip control and a RichTextBox control.
Three of the buttons are for aligning the text, i.e., Align Left, Center, Align Right.
And two of the buttons are for increasing and decreasing Indentation.

I have the CheckOnClick property set to true for these buttons.

My application also has formatting buttons, i.e., Bold, Italic, Underlined and one button for setting a bulleted style.

It was previously suggested that I use the RichTextBox_SelectionChanged event, which in fact works for the formatting buttons and Bullets button.

However, I am running into a dead-end when attempting to write code for the alignment buttons or the 2-Indentation buttons. For example, when I try something like the following code:

<pre>tsBtnAlignLeft.Checked = richTextBoxBody.SelectionAlignment;
tsBtnAlignCtr.Checked = richTextBoxBody.SelectionAlignment;
tsBtnAlignRight.Checked = richTextBoxBody.SelectionAlignment;</pre>

it throws this exception:
"Cannot implicitly convert type System.Windows.Forms.HorizontalAlignment' to 'bool'"

And when I try to add further code in the RTB's SelectionChanged event for the IncreaseIndentation or DecreaseIndentation button's, i.e.,
<code>tsbtnIncreaseIndent.Checked = richTextBoxBody.SelectionIndent;</code>
it throws the following exception:
"Cannot implicitly convert type 'int' to 'bool'"

Can anyone provide a suggestion for getting the Checked property of the alignment buttons and the indentation buttons to reflect the contents of the RichTextBox as the cursor moves over text that is aligned and\or indented?

Thank you in advance.

Richard
AnswerRe: Getting ToolStrip button's CheckState to reflect RichTextBox content Pin
Cassandra Ross14-Jan-09 11:43
Cassandra Ross14-Jan-09 11:43 
AnswerRe: Getting ToolStrip button's CheckState to reflect RichTextBox content Pin
Member 263050315-Jan-09 4:50
Member 263050315-Jan-09 4:50 
QuestionBindng and display problem Pin
wi5nia14-Jan-09 9:52
wi5nia14-Jan-09 9:52 
AnswerRe: Bindng and display problem Pin
Wendelius14-Jan-09 11:14
mentorWendelius14-Jan-09 11:14 
QuestionRe: Bindng and display problem Pin
wi5nia14-Jan-09 11:22
wi5nia14-Jan-09 11:22 
AnswerRe: Bindng and display problem Pin
Wendelius14-Jan-09 11:28
mentorWendelius14-Jan-09 11:28 
GeneralRe: Bindng and display problem Pin
wi5nia14-Jan-09 11:31
wi5nia14-Jan-09 11:31 
GeneralRe: Bindng and display problem Pin
Wendelius14-Jan-09 11:44
mentorWendelius14-Jan-09 11:44 
GeneralRe: Bindng and display problem Pin
wi5nia14-Jan-09 11:53
wi5nia14-Jan-09 11:53 
GeneralRe: Bindng and display problem Pin
Wendelius14-Jan-09 12:00
mentorWendelius14-Jan-09 12:00 
QuestionXDate in ZedGraph Pin
Rayya14-Jan-09 9:23
Rayya14-Jan-09 9:23 
AnswerRe: XDate in ZedGraph Pin
EliottA14-Jan-09 12:44
EliottA14-Jan-09 12:44 
QuestionTelephone answering mechine service c# Pin
rikigr414-Jan-09 8:40
rikigr414-Jan-09 8:40 
AnswerRe: Telephone answering mechine service c# Pin
#realJSOP14-Jan-09 9:46
professional#realJSOP14-Jan-09 9:46 
GeneralRe: Telephone answering mechine service c# Pin
User 665814-Jan-09 10:09
User 665814-Jan-09 10:09 
AnswerRe: Telephone answering mechine service c# Pin
Rutvik Dave14-Jan-09 11:18
professionalRutvik Dave14-Jan-09 11:18 
GeneralRe: Telephone answering mechine service c# Pin
rikigr414-Jan-09 21:18
rikigr414-Jan-09 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.