|
-
Aug 1st, 2022, 11:47 PM
#1
Thread Starter
Hyperactive Member
Re: Plotting a line chart problem (In user control)
 Originally Posted by Delaney
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.
 Originally Posted by Delaney
don't you have to put the name of the usercontrol before the name of the control in the code?
Not sure.
 Originally Posted by Delaney
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|