Tech Off Post

Single Post Permalink

View Thread: form keeps loosing focus on VS2005
  • User profile image
    Shark_M

    after some investigation into my code i fixed the problem

    With Browser.Document.Body
                .InnerHtml = String.Concat(.InnerHtml, "<small>", HTMLMsg, "</small><br>")
                .ScrollTop = CInt(.InnerHtml.Length() * 1000)
    .RemoveFocus()
     End With

    the .RemoveFocus () removed the focus not from the webbrowser control, but from all the form, and that was what happened

    i meant to remove focus from the webbrowser only, and not from the entire form

    so i just removed that line and all worked as expected