Results 1 to 5 of 5

Thread: [RESOLVED] Plotting a line chart problem (In user control)

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    Re: Plotting a line chart problem (In user control)

    Quote Originally Posted by Delaney View Post
    can you post the code in the user control ?
    Yes sir, But it is nothing much:
    Code:
    Public Class ITEM
        Private Sub Label1_TextChanged(sender As Object, e As EventArgs) Handles Label1.TextChanged
            Try
                chartx.Text = Val(chartx.Text) + 1
                Chart1.Series("Series1").Points.AddXY(Val(chartx.Text), Val(Label1.Text))
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Critical)
            End Try
        End Sub
    End Class
    Translasion: Once Label1 value changes, a variable increment will occur and current-value under chartx (represents steps) also shown under x,y.

    Quote Originally Posted by Delaney View Post
    don't you have to put the name of the usercontrol before the name of the control in the code?
    Not sure.

    Quote Originally Posted by Delaney View Post
    yourusercontrolname.Chart1.series ....
    Well, I tried it now, dot after UserControl1 opens a list of properties which none of its controls are not available in it, therefore "UserControl1.Chart1" doesn't exist. I added Chart1 to a TabControl it doesn't make difference right? I'm new to VB.NET behavior/logic.
    Update: "Me.Chart1." does exist tho. But same exceptions will occur.

    * Is it possible that an option (explicit, strict, compare, infer and etc.) rectifies the matter? It seemed easier at first but it's not... : (
    Last edited by pourkascheff; Aug 2nd, 2022 at 12:18 AM.

Tags for this Thread

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