Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free Richtextbox control

Status
Not open for further replies.

drew10

Programmer
Feb 26, 2002
123
US
I needed to implement a richtextbox control for a site I'm working on, and I stumbled across . They provide a free open source rich textbox control in c#. All you have to do is download and run the executable. It creates a virtual directory in the folder. From there you can reference it from a vb app or a c# app or whatever. It seems very comparable to control, but it's free and open source. If anybody wants to use it with a vb app, I have rewritten the source code for the sample.aspx.cs page to work with vb.net. I'll try to post a sample website with source code tonight, then I'll include the link here.

-drew10
 
Thanks Drew - I could do with the vb version is that is possible. Cheers
 
After installing the cwebrun yahenet executable, there will be a yahe directory in the folder. When you want to use the control in a vb.net project, just browse to and add a reference to the YAHELib.dll. You can even add the control to your vs.net toolbar and just drag and drop it onto webforms. If you don't do the drag and drop method, just copy their html source code from sample.aspx. For the code behind, use:

Code:
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls

Public Class WebForm1
    Inherits System.Web.UI.Page
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected YAHENet1 As CWebRun.Editor.YAHENet

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        AddHandler YAHENet1.EditorHTMLSaved, New CWebRun.Editor.YAHENet.EditorHTMLSavedHandler(AddressOf OnEditorHTMLSaved)
        AddHandler Me.Load, New System.EventHandler(AddressOf Me.Page_Load)
    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack() Then
            YAHENet1.HTMLValue = &quot;This is the initial value&quot;
        End If
    End Sub

    Protected Overrides Sub oninit(ByVal e As EventArgs)
        InitializeComponent()
        MyBase.OnInit(e)
    End Sub

    Private Sub OnEditorHTMLSaved(ByVal sender As Object, ByVal e As CWebRun.Editor.YAHENet.EditorEventArgs)
        Label1.Text = YAHENet1.HTMLValue
    End Sub

End Class

Then everything should work. What I like about this is that you have the source code, so you can change the function of the buttons or add more, etc...

hth
-drew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top