-
Dec 4th, 2013, 09:05 AM
#1
Thread Starter
Junior Member
[RESOLVED] convert existing RTB to TransparentRTB
Hi.
I have a richtextbox created in the design view.
I coded several things for it and now I realised I need it to be transparent.
I found some TranbsparentRTB class codes and inserted one in my project (it inherits the RichTextBox class).
My problem is how to tell it that the excepbox wich is defined as System.Windows.Forms.RichTextBox is now a TransparentRichTextBox...
I changed in Form.Designer.vb to Me.excepBox = New TransparentRichTextBox but then several errors appear on another locations because it treats it like a 1-dimensional array...
Where is my error?
the way I call the class?
any (basic) help is appreciated.
Thanks
-
Dec 4th, 2013, 10:03 AM
#2
Junior Member
Re: convert existing RTB to TransparentRTB
i think you should post more of your code snippets. please post your full code here if it's possible.
-
Dec 4th, 2013, 10:05 AM
#3
Re: convert existing RTB to TransparentRTB
It's a control... so you'll need to grab it from your toolbox and add it to your form... much like you did the original RTB...
Personally, I'd put it in its own project/assembly, compile it, add it to your toolbox, then reference it from your app... then drop it onto your form (or just drop it onto the form, and VS will automatically reference the assembly for you.)
-tg
-
Dec 4th, 2013, 11:06 AM
#4
Re: convert existing RTB to TransparentRTB
Generally, this is a custom control.
I found some TranbsparentRTB class codes and inserted one in my project (it inherits the RichTextBox class).
-
Dec 4th, 2013, 05:40 PM
#5
Thread Starter
Junior Member
Re: convert existing RTB to TransparentRTB
thanks a lot.
just dragged the control from the toolbox... :-)
-
Dec 4th, 2013, 05:51 PM
#6
Re: [RESOLVED] convert existing RTB to TransparentRTB
you could've edited your form's designer.vb file. you can find the file by clicking 'Show all files' in the Solution Explorer window.
assuming the name of the control is TransparentRichTextBox:
Code:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.RichTextBox1 = New System.Windows.Forms.RichTextBox 'change to New TransparentRichTextBox
Me.SuspendLayout()
'
'RichTextBox1
'
Me.RichTextBox1.Location = New System.Drawing.Point(12, 12)
Me.RichTextBox1.Name = "RichTextBox1"
Me.RichTextBox1.Size = New System.Drawing.Size(100, 96)
Me.RichTextBox1.TabIndex = 0
Me.RichTextBox1.Text = ""
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 262)
Me.Controls.Add(Me.RichTextBox1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
Friend WithEvents RichTextBox1 As System.Windows.Forms.RichTextBox 'change to TransparentRichTextBox
End Class
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Dec 4th, 2013, 08:12 PM
#7
Re: [RESOLVED] convert existing RTB to TransparentRTB
Yeaaaah..... I thought about that too... but seems like when I try to do something like that, it just never goes well...
-tg
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|