I would like to ask what is the code for this text effect on C# when for example, I have this PROTECT YOUR COMPUTER title, then, when I point my cursor on it, it should be underlined, and when I click it, the contents inside it should be shown below the title. It is commonly used in Help and Support Section when your using Windows.
Thanks in advance! and Sorry for my english.
I think you are looking for the LinkLabel control.
Related
I was wondering if someone knew how to "invoke" this kind of messagebox in C# or VB.NET
Don't take any notice of what is written in messagebox it's in French ^^
Thank you for your help !
What you are looking for is called Task Dialog. You can find out how to implement them in your WinForms application here.
EDIT:
Oh, look, someone has even created a wrapper to use them in WPF.
You can change the style of a Form in its properties and make it like a message box. Then add on it every item you need in ur "messagebox". When you wanto to show it, simply create a new instance of that form and it will appear.
Alternatively, check here: http://www.dreamincode.net/forums/topic/102866-how-to-display-combobox-items-in-message-box/
I am coding a Windows Forms Application in C#, and one of the requirements is to display some html code in a control, with the correct colors that correspond to the relevant tags.
E.g. When right clicking on a webpage in Google Chrome, then selecting View Page Source, a form is shown with all the html, correctly formatted, with tag colors and each line of code's line number.
Is there a free, reliable control that can do this? Is there an inbuilt Microsoft control that does this?
As I am new to this area of coding, can someone please provide me with some useful names, and some resource links if possible? I am not sure of the correct name for a control that does this, and as such, my Google searches have not come up with what I am looking for.
Also, the control needs to be trustworthy.
Thanks
You can try ScintillaNET control. It's open source and has HTML syntax highlighting as well as many other features.
I am working in a wpf project in which I need to compare two strings and display in a side by side window with line number should be shown and differences must be highlighted with color.
I am new to wpf and I don't have any idea about completing this task.
Please help me.
Are you looking at something like Syntax Highlighting of Text after comparison(or identifying the differences)? Below links might help you if you want to do simple highlighting of the text. The idea should be simple perhaps:
Identify the Difference
Find the start and end position of difference
Highlight the difference only.
If you'd want to go for simple solution, check these link if they work for u:
https://code.msdn.microsoft.com/windowsdesktop/CSWPFSearchAndHighlightText-3b5e207a
https://social.msdn.microsoft.com/Forums/vstudio/en-US/7c9a622a-4e3b-451e-bc4c-ab9d011447e0/texthighlighting-in-wpf-richtextbox?forum=wpf
Moreover, there are several controls available online for Syntax Highlighting in wpf. You can simply search for it. I came across Fast Colored TextBox on CodeProject once for similar requirement. Hope this helps.
I think this would be the generic advise I might be able to offer for a generic question like this. Or u may want to go a bit more specific about what type of content you are trying to highlight? Is it Rich text or plain text in a TextBlock? And as the comment above? Any research & considerations you've done? And any code to give an idea about the scenario?
I have a Form which consists of two panels, for simplicity.
One panel consists of, for example, several Controls.
The other panel displays Help text associated with each of these Controls.
When user clicks on each Control in the first panel, the other panel of the application will display some Help text (NOT a separate Help dialog window).
In reality I have many Controls; thence, many different topics. Therefore, ideally, I have a single file that contains all the help topics.
Please let me know how I might do it in C#, Winform.
I'd done lots of searches. I'd found something very close but it wasn't implemented in C#. http://www.codeproject.com/Articles/281/Embedding-an-HTML-Help-window-into-a-dialog
Help Class or HelpProvider won't do the job as it launches the Help text in a separate dialog outside my application.
Could someone please help. Thanks in advance.
Maybe I am oversimplifying or even misunderstanding what you are shooting for, but it sounds like you already have the solution (for the most part). Just put a label in the help panel that the other panel will update appropriately.
Pseudocode:
item in main panel is clicked
event method calls helpLabel.Text = "Help Stuff";
I am guessing I am misunderstanding this, though. Since you already have most of this.
How can I put a link in a C# TextBox? I have tried to put HTML tags in the box but instead of showing a link it shows the entire HTML tag. Can this be done with a TextBox?
Use the RichTextBox, no need to build your own, it cames with VS
I would try using an editable div and making it look like a text box. This would allow you to get user input and use links.
To make this easier, try JEditable.
If that is in windows forms and you really can't use the richtextbox, you can create a control with a linklabel inside of textbox.
http://www.codeproject.com/KB/miscctrl/LinkTextBox.aspx
I would think about this a little bit. If you allow executable code in an editable control, the user, the user can execute ANY code. This is generally a bad idea.
The behavior of the C# control is intentional to prevent the exact behavior that you are trying to create. A little creativity (such as parsing out links from the text box and creating a list of links next or below the text box) will provide a much safer application.
To my knowledge not with the standard textbox. You'd have to create your own. One option it the Telerik controls, they're a little pricey for individual development, but very robust and configurable.
For windows application, we can use a webbrowser control. However, for web applications Freetextbox will do the job.This is freely available dll.