Click here to Skip to main content
15,847,963 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Watermark in Crystal report does not show Pin
Eddy Vluggen18-Apr-23 0:20
professionalEddy Vluggen18-Apr-23 0:20 
QuestionCan ChatGPT be used to document VBA Code Pin
YSLGuru5-Apr-23 7:17
YSLGuru5-Apr-23 7:17 
AnswerRe: Can ChatGPT be used to document VBA Code Pin
jschell5-Apr-23 7:20
jschell5-Apr-23 7:20 
GeneralRe: Can ChatGPT be used to document VBA Code Pin
YSLGuru5-Apr-23 7:22
YSLGuru5-Apr-23 7:22 
AnswerRe: Can ChatGPT be used to document VBA Code Pin
Richard MacCutchan5-Apr-23 7:25
mveRichard MacCutchan5-Apr-23 7:25 
GeneralRe: Can ChatGPT be used to document VBA Code Pin
YSLGuru5-Apr-23 7:35
YSLGuru5-Apr-23 7:35 
GeneralRe: Can ChatGPT be used to document VBA Code Pin
Richard MacCutchan5-Apr-23 7:41
mveRichard MacCutchan5-Apr-23 7:41 
GeneralRe: Can ChatGPT be used to document VBA Code Pin
YSLGuru5-Apr-23 9:31
YSLGuru5-Apr-23 9:31 
AnswerRe: Can ChatGPT be used to document VBA Code Pin
YSLGuru5-Apr-23 7:37
YSLGuru5-Apr-23 7:37 
Questionvb.net - how do I add a row in a datagridview to an existing object? Pin
Member 130653743-Apr-23 22:54
Member 130653743-Apr-23 22:54 
AnswerRe: vb.net - how do I add a row in a datagridview to an existing object? Pin
Richard MacCutchan3-Apr-23 23:36
mveRichard MacCutchan3-Apr-23 23:36 
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 

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.