Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 469
  • Last Modified:

Insert HTML List header in windows forms WebBrowser document

I have a .Net 4 Windows Forms project with Visual Studio 2010 using c#.

I have a WebBrowser control on the form and can add an HTML list to the document using the method:
Document.ExecCommand("InsertUnOrderedList", false, null);

Open in new window

What I need to do is have a list header <LH> added to this list.  How can I do this?
0
canuckconsulting
Asked:
canuckconsulting
  • 2
1 Solution
 
Easwaran ParamasivamCommented:
You can use simple javascript to achive this instead of Document.ExecCommand().

<ul style="YourStyle">
<LH>Your List Header</LH>
<script type="text/javascript">
foreach (something)
{
document.write('<li>'+something+'<\/li>')
}
</script>
</ul>
0
 
canuckconsultingAuthor Commented:
I'm doing this in a c# program though...creating and modifying the document on the fly.  I think i need to modify it using the document object as opposed to Javascript?
0
 
Easwaran ParamasivamCommented:
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now