Hi All,
Is it possible to load a .html file (containing a simple table) in a richtextbox ?
if yes how ?
the reason why i wanna do that is i want to highlight certain text after the content has been loaded in the RTB.
Printable View
Hi All,
Is it possible to load a .html file (containing a simple table) in a richtextbox ?
if yes how ?
the reason why i wanna do that is i want to highlight certain text after the content has been loaded in the RTB.
do you want it as raw HTML? If so, then simply set the text property to the HTML. If you want the HTML to be converted into the RTF equivalent and have the markup show in the RTB... it would need to be run through an HTML2RTF converter of some kind.
-tg
What about using a WebBrowser control instead, first parsing the html and highlighting what you want, then use the browsers DocumentText property to display the page?
ok guys i found a work around, but der's still few probs...
this is wht my tool does :
- Take a shared folder path as input on a textbox
- Pass that path to a powershell script & run that script using "shell" --> cmd.exe /c powershell -nologo -noninteractive "C:\MyFolder\first.ps1"
- My powershell script will dump a HTML file as its output
- I'll load that HTML in a webrowser control on my form.
Here are the problems i'm facing...
1- During run time i need to create the powershell script (C:\MyFolder\first.ps1) which has HTML code for creating a table which looks like this :
for writing this to a .ps1 file (using StreamWriter) i need to add lots of "quotes" since it recognises --> $, <> , {} as operational characters is there any i can simply dump the above code into a file without having to format it, it's really tiresome :(Code:$a = "<style>"
$a = $a + "BODY{background-color:skyblue;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:palegoldenrod}"
$a = $a + "</style>"
2- Original problem : is der any way i can highlight certain text on webBrowser control ?
I'm not advanced coder so i'll be grateful if you provide me a code along with reply.. thx already ! :)
any 1 pls....
guys, sorry for double-posting but i'm still stuck on this, i simply need to know how can i easily write below code to a file (using streamwriter or equivalent)
Code:$a = "<style>"
$a = $a + "BODY{background-color:skyblue;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:palegoldenrod}"
$a = $a + "</style>"