Results 1 to 3 of 3

Thread: Add <br/> to webbrowser on return...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Posts
    170

    Add <br/> to webbrowser on return...

    I have a WebBrowser control added to my form, which I am allowing users to create custom html email templates. The problem I have is that when you with the 'Return' key, the cursor jumps what looks like 2 lines. I've looked at the HTML behind it and it seems to add a <p> (Paragraph) item each time, whereas I would like a line break <br/> to be using when the return key is pressed.

    I have looked around and am unable to find anything. Could someone help me to to override the KeyPress event on the WebBrowser and for a <br/> to be used instead of <p>. I know that the WebBrowser does not have a KeyPress event, hence I need some help on how to capture key presses.

    Thanks in advance

    Simon

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,375

    Re: Add <br/> to webbrowser on return...

    How is the html being generated for the WebBrowser? Are you using a tool found on the internet or are you using a textbox?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Add <br/> to webbrowser on return...

    Typically, depending on what you're using, the Enter is "next paragraph" in which case the <p></p> is semantically correct. The Ctrl-Enter though creates a break, which is what you're after.

    But it depends on what you're using to generate the HTML in the first place... the webbrowser doesn't create HTML... it consumes it and renders it.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width