Click here to Skip to main content
15,884,099 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Can ChatGPT be used to document VBA Code Pin
YSLGuru5-Apr-23 8:31
YSLGuru5-Apr-23 8:31 
AnswerRe: Can ChatGPT be used to document VBA Code Pin
YSLGuru5-Apr-23 6:37
YSLGuru5-Apr-23 6:37 
Questionvb.net - how do I add a row in a datagridview to an existing object? Pin
Member 130653743-Apr-23 21:54
Member 130653743-Apr-23 21:54 
AnswerRe: vb.net - how do I add a row in a datagridview to an existing object? Pin
Richard MacCutchan3-Apr-23 22:36
mveRichard MacCutchan3-Apr-23 22:36 
QuestionProperties on Custom Control Pin
robert1131-Mar-23 20:29
robert1131-Mar-23 20:29 
AnswerRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 0:05
mveRalf Meier1-Apr-23 0:05 
AnswerRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 0:13
mveRalf Meier1-Apr-23 0:13 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 9:33
robert111-Apr-23 9: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 10:16
mveRalf Meier1-Apr-23 10:16 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 12:05
robert111-Apr-23 12:05 
GeneralRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 22:46
mveRalf Meier1-Apr-23 22:46 
AnswerRe: Properties on Custom Control Pin
Ralf Meier1-Apr-23 23:29
mveRalf Meier1-Apr-23 23:29 
GeneralRe: Properties on Custom Control Pin
robert112-Apr-23 2:15
robert112-Apr-23 2:15 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 2:20
mveRalf Meier2-Apr-23 2:20 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 2:23
mveRalf Meier2-Apr-23 2:23 
GeneralRe: Properties on Custom Control Pin
robert112-Apr-23 2:32
robert112-Apr-23 2:32 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 3:12
mveRalf Meier2-Apr-23 3:12 
GeneralRe: Properties on Custom Control Pin
robert112-Apr-23 4:33
robert112-Apr-23 4:33 
GeneralRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 5:19
mveRalf Meier2-Apr-23 5:19 
GeneralMessage Closed Pin
2-Apr-23 5:36
robert112-Apr-23 5:36 
SuggestionRe: Properties on Custom Control Pin
Ralf Meier2-Apr-23 5:42
mveRalf Meier2-Apr-23 5:42 
GeneralRe: Properties on Custom Control Pin
Eddy Vluggen1-Apr-23 12:20
professionalEddy Vluggen1-Apr-23 12:20 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 12:34
robert111-Apr-23 12:34 
GeneralRe: Properties on Custom Control Pin
Eddy Vluggen1-Apr-23 13:13
professionalEddy Vluggen1-Apr-23 13:13 
GeneralRe: Properties on Custom Control Pin
robert111-Apr-23 13:47
robert111-Apr-23 13:47 

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.