is there any free panel or frame or groupbox control that has a header where i can type text, maybe with gradient?
Thanks
Printable View
is there any free panel or frame or groupbox control that has a header where i can type text, maybe with gradient?
Thanks
I think you have to use GDI to draw border plus label to do that.
If you know WPF then this is a example about that :
http://www.vbdotnetheaven.com/UploadFile/rohatash/5311/ :)
will WPF work in .net 2.0?
Hi,
WPF is brought to world within .net 3.0 and you'd better follow that.
Then change it this way:
1. You get VS 2008
2. Take your old project.
3. Change the targetting to .net 3.0/3.5 so slight conversion takes place against your project files.
4. Ensure that the project is built and runs without changes
5. Add references to your WPF assemblies containing prepared WPF forms or add the form to a project
6. Use WPF interop bringing the form/control into Winforms
am targeting winxp upwards and .net 2.0 framework. am borderd about .net 3.0 download which is very large.
The following custom GroupBox I created has a TextBox where the Text of the GroupBox is usually located. I am sure the logic for sizing the TextBox could use some more work but my simple test it works fine.
Add the class (see attachment) to your project, build then place the control onto your form and try it out. Again I am sure it will need some tweaking which I do not have time at the moment to do.
Code:Public Class GroupBoxTextBox
Inherits GroupBox
Private WithEvents mTextBox As New TextBox
Public Sub New()
MyBase.New()
mTextBox = New TextBox
mTextBox.Multiline = True
mTextBox.Location = New Drawing.Point(0, 0)
Me.Controls.Add(mTextBox)
mTextBox.Text = mTextBox.Text
MyBase.Text = ""
End Sub
Public Overrides Property Text() As String
Get
Return MyBase.Text
End Get
Set(ByVal Value As String)
MyBase.Text = ""
mTextBox.Text = Value
Dim gr As Drawing.Graphics = Me.CreateGraphics
Dim Size As Drawing.SizeF = gr.MeasureString(mTextBox.Text, Me.Font)
Dim ProposedWidth As Integer = CInt(Size.Width + 20)
If ProposedWidth < Me.ClientSize.Width Then
mTextBox.Size = New Drawing.Size(ProposedWidth, CInt(Size.Height + 5))
Else
' Constrain TextBox width within the parent client area
mTextBox.Size = New Drawing.Size(Me.ClientSize.Width - 5, CInt(Size.Height + 5))
End If
End Set
End Property
End Class