Notes
Notes - notes.io |
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
HScrollBar1.Minimum = 0
HScrollBar1.Maximum = 255
HScrollBar1.LargeChange = 1
HScrollBar2.Minimum = 0
HScrollBar2.Maximum = 255
HScrollBar2.LargeChange = 1
HScrollBar3.Minimum = 0
HScrollBar3.Maximum = 255
HScrollBar3.LargeChange = 1
HScrollBar1.Value = 0
HScrollBar2.Value = 0
HScrollBar3.Value = 0
TextBox1.Text = "0"
TextBox2.Text = "0"
TextBox3.Text = "0"
End Sub
Private Sub TextBox1_MouseLeave(sender As Object, e As EventArgs) Handles TextBox1.MouseLeave
Try
Dim sayi As Integer = Convert.ToInt32(TextBox1.Text)
If sayi < 0 Or sayi > 255 Then
Throw New Exception()
End If
HScrollBar1.Value = sayi
draw()
Catch ex As Exception
MessageBox.Show("Girilen sayi dogru degil")
TextBox1.Focus()
End Try
End Sub
Private Sub TextBox2_MouseLeave(sender As Object, e As EventArgs) Handles TextBox2.MouseLeave
Try
Dim sayi As Integer = Convert.ToInt32(TextBox2.Text)
If sayi < 0 Or sayi > 255 Then
Throw New Exception()
End If
HScrollBar2.Value = sayi
draw()
Catch ex As Exception
MessageBox.Show("Girilen sayi dogru degil")
TextBox2.Focus()
End Try
End Sub
Private Sub TextBox3_MouseLeave(sender As Object, e As EventArgs) Handles TextBox3.MouseLeave
Try
Dim sayi As Integer = Convert.ToInt32(TextBox3.Text)
If sayi < 0 Or sayi > 255 Then
Throw New Exception()
End If
HScrollBar3.Value = sayi
draw()
Catch ex As Exception
MessageBox.Show("Girilen sayi dogru degil")
TextBox3.Focus()
End Try
End Sub
Private Sub HScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles HScrollBar1.Scroll, HScrollBar2.Scroll, HScrollBar3.Scroll
TextBox1.Text = HScrollBar1.Value
TextBox2.Text = HScrollBar2.Value
TextBox3.Text = HScrollBar3.Value
draw()
End Sub
Sub ortalama()
Dim toplam As Double
Dim ort As Integer
If HScrollBar1.Value = 0 And HScrollBar2.Value = 0 And HScrollBar3.Value = 0 Then
toplam = 1
Else
toplam = (Convert.ToDouble(HScrollBar1.Value) + Convert.ToDouble(HScrollBar2.Value) + Convert.ToDouble(HScrollBar3.Value))
End If
ort = Convert.ToInt32(Convert.ToDouble(HScrollBar1.Value) / toplam * 100)
Label4.Text = "%" & ort
ort = Convert.ToInt32(Convert.ToDouble(HScrollBar2.Value) / toplam * 100)
Label5.Text = "%" & ort
ort = Convert.ToInt32(Convert.ToDouble(HScrollBar3.Value) / toplam * 100)
Label6.Text = "%" & ort
End Sub
Sub draw()
PictureBox1.BackColor = Color.FromArgb(HScrollBar1.Value, HScrollBar2.Value, HScrollBar3.Value)
ortalama()
End Sub
End Class
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team