WinForm Implementation QQ Chat bubble 200 lines of code

Source: Internet
Author: User

C # WinForm implementation of QQ chat bubble interface, the principle is very simple, through the Webkitbrowser (third-party browser control, because of the poor compatibility) loading HTML code implementation, chat interface is a pure HTML code, and QQ chat interface can be compared, very good, Because it is HTML, so extensibility is very large, click the Send button can be text box to join chat, the project development process encountered a few difficulties are resolved, such as:

1, how to chat the new message after inserting the scroll bar scroll to the bottom, here I search online webkitbrowser scroll bar usage can not find, so here I used the anchor link through each load HTML with JS jump to the anchor point to achieve the scroll bar always at the bottom;

2, the compatibility of the HTML problem, originally I started with built-in WebBrowser to develop, because his kernel is IE many HTML effects can not be released, so using a third-party control Webkitbrowser, this control disadvantage is the need to use a lot of DLLs, in the bin directory.

3, beautify the scroll bar (online code)

。 Project complete projects: Click to download

Here are the following:

Here's some code:

    Private voidForm1_Load (Objectsender, EventArgs e) {webkitbrowser1.iswebbrowsercontextmenuenabled=false;//set the control's Iswebbrowsercontextmenuenabled property to False to prevent the WebBrowser control from displaying its shortcut menu when the user right-clicks it.            stringSB =""; SB=@""; Webkitbrowser1.documenttext=SB; }

WinForm Implementation QQ Chat bubble 200 lines of code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.