Click here to Skip to main content
15,851,242 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionProperties on Custom Control Pin
robert1131-Mar-23 21:29
robert1131-Mar-23 21:29 
AnswerRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 1:05
professionalRalf Meier1-Apr-23 1:05 
AnswerRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 1:13
professionalRalf Meier1-Apr-23 1:13 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 10:33
robert111-Apr-23 10:33 
Appreciate the sample.

Am almost there! now have everything under my category, now only issue is the following code.
FYI, i inherit a PictureBox on 1st class. then i have the category items on a 2nd class.
my problem is with the "OnPaint" event
VB
Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
        MyBase.OnPaint(pe)
        'Fields
        Dim graph = pe.Graphics
        Dim rectContourSmooth = Rectangle.Inflate(ClientRectangle, -1, -1)
        Dim rectBorder = Rectangle.Inflate(rectContourSmooth, -m_borderSizeField, -m_borderSizeField)
        Dim smoothSize = If(m_borderSizeField > 0, m_borderSizeField * 3, 1)
        Dim newText = m_captiontext

        Using borderGColor = New LinearGradientBrush(rectBorder, m_borderColorField, m_borderColor2Field, m_gradientAngleField)

            Using pathRegion = New GraphicsPath()

                Using penSmooth = New Pen(Parent.BackColor, smoothSize)

                    Using penBorder = New Pen(borderGColor, m_borderSizeField)
                        graph.SmoothingMode = SmoothingMode.AntiAlias
                        penBorder.DashStyle = m_borderLineStyleField
                        penBorder.DashCap = m_borderCapStyleField
                        pathRegion.AddEllipse(rectContourSmooth)
                        'Set rounded region 
                        Region = New Region(pathRegion)

                        graph.DrawString(m_captiontext, New Font("Segoe UI", 12, FontStyle.Regular), New SolidBrush(Color.Black), m_captionx.X, m_captionx.Y, StringFormat.GenericDefault)
                        'Drawing
                        graph.DrawEllipse(penSmooth, rectContourSmooth) 'Draw contour smoothing
                        If m_borderSizeField > 0 Then graph.DrawEllipse(penBorder, rectBorder) 'Draw border
                    End Using
                End Using
            End Using
        End Using

    End Sub
the values with "m_" (these are in the 2nd class) give the following error message in the class view. I have the OnPaint in the 1st class.
VB
(field) NewPictureBox.m_borderSizeField As TextLocation
Operator is not defined for type 'TextLocation'

i am at a loss. are you able to point me in direction so i have the "OnPaint" event in correct class??
Appreciate your help!
AnswerRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 11:16
professionalRalf Meier1-Apr-23 11:16 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 13:05
robert111-Apr-23 13:05 
GeneralRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 23:46
professionalRalf Meier1-Apr-23 23:46 
AnswerRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 0:29
professionalRalf Meier2-Apr-23 0:29 
GeneralRe: Properties on Custom Control Pin
robert112-Apr-23 3:15
robert112-Apr-23 3:15 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 3:20
professionalRalf Meier2-Apr-23 3:20 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 3:23
professionalRalf Meier2-Apr-23 3:23 
GeneralRe: Properties on Custom Control Pin
robert112-Apr-23 3:32
robert112-Apr-23 3:32 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 4:12
professionalRalf Meier2-Apr-23 4:12 
GeneralRe: Properties on Custom Control Pin
robert112-Apr-23 5:33
robert112-Apr-23 5:33 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 6:19
professionalRalf Meier2-Apr-23 6:19 
GeneralMessage Closed Pin
2-Apr-23 6:36
robert112-Apr-23 6:36 
SuggestionRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 6:42
professionalRalf Meier2-Apr-23 6:42 
GeneralRe: Properties on Custom Control Pin
Eddy Vluggen1-Apr-23 13:20
professionalEddy Vluggen1-Apr-23 13:20 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 13:34
robert111-Apr-23 13:34 
GeneralRe: Properties on Custom Control Pin
Eddy Vluggen1-Apr-23 14:13
professionalEddy Vluggen1-Apr-23 14:13 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 14:47
robert111-Apr-23 14:47 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 15:19
robert111-Apr-23 15:19 
PraiseRe: Properties on Custom Control Pin
Eddy Vluggen1-Apr-23 16:04
professionalEddy Vluggen1-Apr-23 16:04 
GeneralRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 23:56
professionalRalf Meier1-Apr-23 23:56 
GeneralRe: Properties on Custom Control Pin
Eddy Vluggen2-Apr-23 0:57
professionalEddy Vluggen2-Apr-23 0:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.