16.1.11

Chart Control VB.NET 2010

Hi Everybody,
I would like to explain one of faq within this essay , how can I can use chart control with VB.NET windows application? If any question, please feel free and contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (chart_control1)



2-) We are designing this windows form in a similar way to bellowing picture



3-) Series Collection(Student)



4-) We are writing this code


Private Sub chart_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chart_btn.Click

Chart1.Series("Student").Points.AddXY("Jon", 10)
Chart1.Series("Student").Points.AddXY("Jordan", 30)
Chart1.Series("Student").Points.AddXY("Yen", 40)
Chart1.Series("Student").Points.AddXY("Nick", 20)

Chart1.Series("Student").ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bar


End Sub


5-) Lets run application and click show button




6-) Change codes and run again

Private Sub chart_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chart_btn.Click

Chart1.Series("Student").Points.AddXY("Jon", 10)
Chart1.Series("Student").Points.AddXY("Jordan", 30)
Chart1.Series("Student").Points.AddXY("Yen", 40)
Chart1.Series("Student").Points.AddXY("Nick", 20)

Chart1.Series("Student").ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie


End Sub




7-) For 3D and run again

Private Sub chart_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chart_btn.Click

Chart1.Series("Student").Points.AddXY("Jon", 10)
Chart1.Series("Student").Points.AddXY("Jordan", 30)
Chart1.Series("Student").Points.AddXY("Yen", 40)
Chart1.Series("Student").Points.AddXY("Nick", 20)

Chart1.Series("Student").ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie

Chart1.Series("Student")("PieLabelStyle") = "Outside"

Chart1.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True




End Sub



1.1.11

Working with Media Player with VB.NET






Hi Everybody,
I would like to explain one of faq within this essay , how can I can use Media Player Component with VB.NET windows application? If any question, please feel free and contact with me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (medua_player_component)



2-) Select Media Player component



3-) We are designing this windows form in a similar way to bellowing picture



4-)We are writing this code

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles start_btn.Click
Try
AxWindowsMediaPlayer1.URL = file_name_txt.Text
Catch ex As Exception
MsgBox(ex.Message, vbCritical, "My Media Player")
End Try

End Sub


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stop_btn.Click
Try
AxWindowsMediaPlayer1.close()
Catch ex As Exception
MsgBox(ex.Message, vbCritical, "My Media Player")
End Try

End Sub

Private Sub select_file_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles select_file_btn.Click
Dim open_file As New OpenFileDialog
open_file.Filter = "Files (*.*)| *.*"

Try
If open_file.ShowDialog() = DialogResult.OK Then

file_name_txt.Text = open_file.FileName
Else
MsgBox("Please select a file", vbInformation, "My Media Player")

End If
Catch ex As Exception
MsgBox(ex.Message, vbCritical, "My Media Player")
End Try

End Sub

5-) Lets run application and click start button