I need to change the Message Box Buttons Ok and Cancel Text to Update and AddNew?
Is it possible in C#.NET or I need to create a form and customize it?
Kindly help me in this.
The MessageBox class does not provide you with option to change the button text. This codeproject article, Localizing System MessageBox allows you do that by simply adding and using the class in your project
It is possible using a MessageBoxManager.dll, which you can get in the following link,
http://www.codeproject.com/Articles/18399/Localizing-System-MessageBox
You cannot change the text in MessageBox Buttons.To implement the scenario you can have your custom message box.Which can be build using User Control and show it as a Dialog whenever needed.
Changing the text of a button on a MessageBox is not possible by default. While the text might be changeable through fake localizations, this does not seem like a good way to do it from my point of view. I encourage creating a separate form.
Related
So im making a WPF project where one of my windows has to let the user see a text. Select parts of this text for being put into an array of strings and no more than that. So he/she musnt be able to edit anything in the text only highlight parts and then click on a button. What WPF control would be smart to use for this?
I'd probably just use TextBox with IsReadOnly set. The various selection properties are all you need after that.
I've got a dialog box that pops up with a dynamic list of numbers, and I'd like to get the box to wrap the text because at the moment it displayed up to screen width and then cuts the rest off.
I know I can use \n to declare a new line, but the list is dynamic - it could be one item, it could be 20.
Is there any way to tell the dialog box to wrap text?
Edit: clarification + example code
I'm not using MessageBox.Show() - our code uses its own defined message box class, but the guts of it calls System.Windows.Forms.Form.ShowDialog(parent). Maybe this isn't as well-behaved (i.e., doesn't wrap) as MessageBox.Show()?
Create your own simple form and add a label. Do the wrapping there... You cannot do that much things with Dialog boxes.
In this way you have much more flexibility to show your information to the user.
Are you using the System.Windows.Forms.TextBox? It has a property WordWrap that you can set to true
No other way for a standart MessageBox. Only creating your own form.
You could programmatically format the text by restricting each line to a specific number of words then inserting a \n or Envoronment.NewLine
I'm building a program similar to Messenger, sort of a chatting software.
I created a textBox to display the conversation log, and I want to make it look like this:
Nick1: Hi.
Nick2: Hello.
How do I make part of the text bold?
I also want to allow users to change their own font, font-color and so on...
Thanks in advance.
Use RichTextBox if building a Windows Forms or a WPF app.
The best way is to use a RichTextEdit control, this control can take RTF format codes to easily format the text the way you want it.
eg.
\pard\plain\ltrpar\f0\fs14\sl240\slmult1\b\ Nick1.\par
\pard\plain\ltrpar\f0\fs14\sl240\slmult1\Hi
will show up as Nick1 Hi
Assuming you're using WPF I'd use an ItemsControl to display the conversion. Then for each item I'd have a couple of TextBlocks one for the user name (which would be bold) and the other for the message.
Hope that helps.
Is there an easy way to add a checkbox (or any other custom control, for that matter) inside a balloon tip?
I want to provide the user with an optional checkbox that reads "Never show this message again".
The balloon tip in question is shown using NotifyIcon.ShowBalloonTip().
an example project can be found here: http://www.codeproject.com/KB/dotnet/EmbCtrlNotIc.aspx
I have what I consider to be a pretty unique problem here, and no idea how to implement. From what I've seen, there is no documentation, tutorials, samples and/or articles on this. I've spent weeks researching, with nothing to show.
The problem:
I need the user to be able to select the contents of a Label Control at runtime, and edit it.
If this can be done by extending the existing Label control, great! Or, if this requires a whole new Label Control to be created, fine. So be it.
Using a TextBox is not an option I'm afraid.
Any help at all is greatly appreciated!
Thank you,
jase
If it's just because a look & feel issue you can make a TextBox control look the same as a label would looks like (just guessing since I can't imagine any reason for not using a TextBox).
Could you pop up a window with a text box in it and then have them edit it there, then set the text property of the label based on the edited text box or do you need to edit it in place? You can set the label text at runtime, but for user input you will have to use a text box.