Results 1 to 6 of 6

Thread: panel control with

  1. #1

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    panel control with

    is there any free panel or frame or groupbox control that has a header where i can type text, maybe with gradient?

    Thanks
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  2. #2
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: panel control with

    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/
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  3. #3

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: panel control with

    will WPF work in .net 2.0?
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  4. #4
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: panel control with

    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
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  5. #5

    Thread Starter
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: panel control with

    am targeting winxp upwards and .net 2.0 framework. am borderd about .net 3.0 download which is very large.
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  6. #6
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: panel control with

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width