Programlama yapalım ve Öğrenelim. - Örnek kodlar
  Ana Sayfa
  .NET Eğitim Notları
  Visual C# .NET Örnek Kodları
  VisualBasic.NET Örnek Kodları
  => Örnek kodlar
  => Örnek kodlar2
  J# Örnekleri
  ASP.NET Örnek Kodları
  Delphi Eğitim
  İletişim

Frame ve şeffaflık kullanımı:

'COPYRİGHT ZEKİ GÖRÜR 08.05.2009 SAAT 12:15

Imports System.Drawing.Drawing2D

Imports System

Imports System.Drawing.Text

Imports System.Drawing

Imports System.Windows.Forms

Imports System.Math

 

 

Public Class Form1

 

    Private Sub Form1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DoubleClick

        Me.Close()

 

    End Sub

 

 

 

    Private Sub Form1_Paint(ByVal sender As Object, _

     ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

        Dim txt As String = "08.05.2009 ZEKİ GÖRÜR"

        Dim graphics_path As New GraphicsPath

        graphics_path.AddString(txt, _

            New FontFamily("Times New Roman"), _

            FontStyle.Bold, 70, _

            New Point(0, 0), _

            New StringFormat)

 

        Me.Region = New Region(graphics_path)

 

        Dim origin As Point = Me.PointToScreen(New Point(0, 0))

        e.Graphics.SmoothingMode = SmoothingMode.AntiAlias

        e.Graphics.TranslateTransform(Me.Left - origin.X, Me.Top - origin.Y)

        e.Graphics.DrawPath(New Pen(Color.Black, 5), graphics_path)

 

    End Sub

 

 

 

 

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

 

        'Form1

        '

        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

        Me.ClientSize = New System.Drawing.Size(999, 700)

        Me.Name = "Form1"

        Me.Text = "TransformArrow"

        Me.ResumeLayout(False)

        Me.SuspendLayout()

 

    End Sub

 

End Class

 

Şeffaf çerçeve:

Imports System

Imports System.Runtime.InteropServices

Imports System.Drawing

Imports System.ComponentModel

Imports System.Windows.Forms

Imports System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock

 

 

Public Class Form1

 

   

 

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove

        Me.Close()

    End Sub

 

 

 

    ' Make the form's background transparent.

 

    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

        Dim thick_pen As New Pen(Color.Black, 10)

        Dim rect As New Rectangle(e.ClipRectangle.X + 10, e.ClipRectangle.Y + 10, _

                                  e.ClipRectangle.Width - 20, e.ClipRectangle.Height - 20)

        e.Graphics.DrawRectangle(thick_pen, rect)

        thick_pen.Dispose()

    End Sub

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

 

 

        Me.Label1 = New System.Windows.Forms.Label

        Me.SuspendLayout()

        '

        'Label1

        '

        Me.Label1.AutoSize = True

        Me.Label1.BackColor = System.Drawing.SystemColors.Control

        Me.Label1.Font = New System.Drawing.Font("Forte", 48.0!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

        Me.Label1.Location = New System.Drawing.Point(48, 56)

        Me.Label1.Name = "Label1"

        Me.Label1.Size = New System.Drawing.Size(169, 700)

        Me.Label1.TabIndex = 0

        Me.Label1.Text = "ZEKİ GÖRÜR 2009 saat 12:25  " + vbCr + "hep iyi olun"

        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter

        '

        'Form1

        '

        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

        Me.BackColor = System.Drawing.Color.Red

        Me.ClientSize = New System.Drawing.Size(274, 187)

        Me.Controls.Add(Me.Label1)

        Me.Name = "Form1"

        Me.Text = "Şeffaf formum"

        Me.WindowState = FormWindowState.Maximized

        Me.ResumeLayout(False)

        Me.PerformLayout()

        TransparencyKey = BackColor

        Label1.BackColor = TransparencyKey

 

    End Sub

    Friend WithEvents Label1 As System.Windows.Forms.Label

 

End Class

Radio button:

Imports System.Windows.Forms

 

 

Public Class Form1

    Inherits System.Windows.Forms.Form

 

 

    'NOTE: The following procedure is required by the Windows Form Designer

    'It can be modified using the Windows Form Designer. 

    'Do not modify it using the code editor.

    Friend WithEvents Label1 As System.Windows.Forms.Label

    Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton

    Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton

    Friend WithEvents RadioButton3 As System.Windows.Forms.RadioButton

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.Label1 = New System.Windows.Forms.Label()

        Me.RadioButton1 = New System.Windows.Forms.RadioButton()

        Me.RadioButton2 = New System.Windows.Forms.RadioButton()

        Me.RadioButton3 = New System.Windows.Forms.RadioButton()

        Me.SuspendLayout()

        '

        'Label1

        '

        Me.Label1.Location = New System.Drawing.Point(32, 152)

        Me.Label1.Name = "Label1"

        Me.Label1.Size = New System.Drawing.Size(232, 23)

        Me.Label1.TabIndex = 0

        '

        'RadioButton1

        '

        Me.RadioButton1.Location = New System.Drawing.Point(32, 24)

        Me.RadioButton1.Name = "RadioButton1"

        Me.RadioButton1.TabIndex = 1

        Me.RadioButton1.Text = "Windows 2000"

        '

        'RadioButton2

        '

        Me.RadioButton2.Location = New System.Drawing.Point(32, 64)

        Me.RadioButton2.Name = "RadioButton2"

        Me.RadioButton2.TabIndex = 2

        Me.RadioButton2.Text = "Linux"

        '

        'RadioButton3

        '

        Me.RadioButton3.Location = New System.Drawing.Point(32, 104)

        Me.RadioButton3.Name = "RadioButton3"

        Me.RadioButton3.TabIndex = 3

        Me.RadioButton3.Text = "Mac OS"

        '

        'Form1

        '

        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

        Me.ClientSize = New System.Drawing.Size(296, 213)

        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.RadioButton3, Me.RadioButton2, Me.RadioButton1, Me.Label1})

        Me.Name = "Form1"

        Me.Text = "RadioButtonDemo"

        Me.ResumeLayout(False)

 

    End Sub

 

 

 

    Private Sub RadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.Click

        Label1.Text = "Current choice: " & RadioButton1.Text

        Label1.Refresh()

    End Sub

 

    Private Sub RadioButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton2.Click

        Label1.Text = "Current choice: " & RadioButton2.Text

        Label1.Refresh()

    End Sub

 

    Private Sub RadioButton3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton3.Click

        Label1.Text = "Current choice: " & RadioButton3.Text

        Label1.Refresh()

    End Sub

 

 

End Class

Radio Button ve font:

'copyrgiht Zeki GÖRÜR 12.05.2009 saat 11:10

Imports System

Imports System.Drawing

Imports System.ComponentModel

Imports System.Windows.Forms

 

 

 

 

Public Class Form1

 

 

    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

        e.Graphics.DrawString("www.inndir.com", Me.Font, Brushes.Black, 10, 10)

    End Sub

 

    Private Sub RadioButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.Click, RadioButton2.Click, RadioButton3.Click

        Dim radio_button As RadioButton = DirectCast(sender, RadioButton)

        Me.Font = New Font(radio_button.Text, 20)

    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

        Me.RadioButton1 = New System.Windows.Forms.RadioButton

        Me.RadioButton2 = New System.Windows.Forms.RadioButton

        Me.RadioButton3 = New System.Windows.Forms.RadioButton

        Me.SuspendLayout()

        '

        'RadioButton1

 

        Me.RadioButton1.AutoSize = True

        Me.RadioButton1.Checked = True

        Me.RadioButton1.Font = New System.Drawing.Font("Comic Sans MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

        Me.RadioButton1.Location = New System.Drawing.Point(264,

        Me.RadioButton1.Name = "RadioButton1"

        Me.RadioButton1.Size = New System.Drawing.Size(114, 22)

        Me.RadioButton1.TabIndex = 0

        Me.RadioButton1.BackColor = Color.Crimson

        Me.RadioButton1.Text = "Comic Sans MS"

 

 

        'RadioButton2

 

        Me.RadioButton2.AutoSize = True

        Me.RadioButton2.Font = New System.Drawing.Font("Times New Roman", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

        Me.RadioButton2.Location = New System.Drawing.Point(264, 40)

        Me.RadioButton2.Name = "RadioButton2"

        Me.RadioButton2.Size = New System.Drawing.Size(120, 19)

        Me.RadioButton2.TabIndex = 1

        Me.RadioButton2.BackColor = Color.DarkSalmon

        Me.RadioButton2.TabStop = False

        Me.RadioButton2.Text = "Times New Roman"

        '

        'RadioButton3

        '

        Me.RadioButton3.AutoSize = True

        Me.RadioButton3.Font = New System.Drawing.Font("Papyrus", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

        Me.RadioButton3.Location = New System.Drawing.Point(264, 72)

        Me.RadioButton3.Name = "RadioButton3"

        Me.RadioButton3.Size = New System.Drawing.Size(70, 25)

        Me.RadioButton3.TabIndex = 2

        Me.RadioButton3.BackColor = Color.Khaki

        Me.RadioButton3.TabStop = False

        Me.RadioButton3.Text = "Papyrus"

        '

        'Form1

        '

        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None

        Me.ClientSize = New System.Drawing.Size(397, 156)

        Me.Controls.Add(Me.RadioButton3)

        Me.Controls.Add(Me.RadioButton2)

        Me.Controls.Add(Me.RadioButton1)

        Me.Name = "Form1"

        Me.Text = "DrawFonts"

        Me.ResumeLayout(False)

        Me.PerformLayout()

 

    End Sub

    Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton

    Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton

    Friend WithEvents RadioButton3 As System.Windows.Forms.RadioButton

 

End Class

Radiobutton ve mesajlar:

'copyrgiht Zeki GÖRÜR 12.05.2009 saat 11:10

Imports System

Imports System.Drawing

Imports System.Windows.Forms

 

 

 

Public Class FrmRadioButton

    Inherits System.Windows.Forms.Form

 

    Private iconType As MessageBoxIcon

    Private buttonType As MessageBoxButtons

 

    Friend WithEvents iconGroupBox As System.Windows.Forms.GroupBox

    Friend WithEvents buttonTypeGroupBox As System.Windows.Forms.GroupBox

    Friend WithEvents radRetryCancel As System.Windows.Forms.RadioButton

    Friend WithEvents radYesNo As System.Windows.Forms.RadioButton

    Friend WithEvents radAbortRetryIgnore As System.Windows.Forms.RadioButton

    Friend WithEvents radOk As System.Windows.Forms.RadioButton

    Friend WithEvents radWarning As System.Windows.Forms.RadioButton

    Friend WithEvents radStop As System.Windows.Forms.RadioButton

    Friend WithEvents radQuestion As System.Windows.Forms.RadioButton

    Friend WithEvents radInformation As System.Windows.Forms.RadioButton

    Friend WithEvents radHand As System.Windows.Forms.RadioButton

    Friend WithEvents radExclamation As System.Windows.Forms.RadioButton

    Friend WithEvents radError As System.Windows.Forms.RadioButton

    Friend WithEvents radAsterisk As System.Windows.Forms.RadioButton

    Friend WithEvents cmdDisplay As System.Windows.Forms.Button

    Friend WithEvents lblDisplay As System.Windows.Forms.Label

    Friend WithEvents radOkCancel As System.Windows.Forms.RadioButton

    Friend WithEvents radYesNoCancel As System.Windows.Forms.RadioButton

    Private Sub FrmRadioButton_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

        Me.radAbortRetryIgnore = New System.Windows.Forms.RadioButton()

        Me.radStop = New System.Windows.Forms.RadioButton()

        Me.radYesNo = New System.Windows.Forms.RadioButton()

        Me.iconGroupBox = New System.Windows.Forms.GroupBox()

        Me.radWarning = New System.Windows.Forms.RadioButton()

        Me.radQuestion = New System.Windows.Forms.RadioButton()

        Me.radInformation = New System.Windows.Forms.RadioButton()

        Me.radHand = New System.Windows.Forms.RadioButton()

        Me.radExclamation = New System.Windows.Forms.RadioButton()

        Me.radError = New System.Windows.Forms.RadioButton()

        Me.radAsterisk = New System.Windows.Forms.RadioButton()

        Me.radYesNoCancel = New System.Windows.Forms.RadioButton()

        Me.radOk = New System.Windows.Forms.RadioButton()

        Me.cmdDisplay = New System.Windows.Forms.Button()

        Me.lblDisplay = New System.Windows.Forms.Label()

        Me.buttonTypeGroupBox = New System.Windows.Forms.GroupBox()

        Me.radRetryCancel = New System.Windows.Forms.RadioButton()

        Me.radOkCancel = New System.Windows.Forms.RadioButton()

        Me.iconGroupBox.SuspendLayout()

        Me.buttonTypeGroupBox.SuspendLayout()

        Me.SuspendLayout()

        '

        'radAbortRetryIgnore

        '

        Me.radAbortRetryIgnore.Location = New System.Drawing.Point(16, 88)

        Me.radAbortRetryIgnore.Name = "radAbortRetryIgnore"

        Me.radAbortRetryIgnore.Size = New System.Drawing.Size(120, 24)

        Me.radAbortRetryIgnore.TabIndex = 2

        Me.radAbortRetryIgnore.Text = "Abort Retry Ignore"

        '

        'radStop

        '

        Me.radStop.Location = New System.Drawing.Point(16, 240)

        Me.radStop.Name = "radStop"

        Me.radStop.Size = New System.Drawing.Size(128, 24)

        Me.radStop.TabIndex = 6

        Me.radStop.Text = "Stop"

        '

        'radYesNo

        '

        Me.radYesNo.Location = New System.Drawing.Point(16, 160)

        Me.radYesNo.Name = "radYesNo"

        Me.radYesNo.Size = New System.Drawing.Size(120, 16)

        Me.radYesNo.TabIndex = 4

        Me.radYesNo.Text = "Yes/No"

        '

        'iconGroupBox

        '

        Me.iconGroupBox.Controls.AddRange(New System.Windows.Forms.Control() {Me.radWarning, Me.radStop, Me.radQuestion, Me.radInformation, Me.radHand, Me.radExclamation, Me.radError, Me.radAsterisk})

        Me.iconGroupBox.Location = New System.Drawing.Point(200, 16)

        Me.iconGroupBox.Name = "iconGroupBox"

        Me.iconGroupBox.Size = New System.Drawing.Size(160, 304)

        Me.iconGroupBox.TabIndex = 3

        Me.iconGroupBox.TabStop = False

        Me.iconGroupBox.Text = "Icon"

        '

        'radWarning

        '

        Me.radWarning.Location = New System.Drawing.Point(16, 272)

        Me.radWarning.Name = "radWarning"

        Me.radWarning.Size = New System.Drawing.Size(128, 24)

        Me.radWarning.TabIndex = 7

        Me.radWarning.Text = "Warning"

        '

        'radQuestion

        '

        Me.radQuestion.Location = New System.Drawing.Point(16, 208)

        Me.radQuestion.Name = "radQuestion"

        Me.radQuestion.Size = New System.Drawing.Size(128, 24)

        Me.radQuestion.TabIndex = 5

        Me.radQuestion.Text = "Question"

        '

        'radInformation

        '

        Me.radInformation.Location = New System.Drawing.Point(16, 168)

        Me.radInformation.Name = "radInformation"

        Me.radInformation.Size = New System.Drawing.Size(128, 24)

        Me.radInformation.TabIndex = 4

        Me.radInformation.Text = "Information"

        '

        'radHand

        '

        Me.radHand.Location = New System.Drawing.Point(16, 128)

        Me.radHand.Name = "radHand"

        Me.radHand.Size = New System.Drawing.Size(128, 24)

        Me.radHand.TabIndex = 3

        Me.radHand.Text = "Hand"

        '

        'radExclamation

        '

        Me.radExclamation.Location = New System.Drawing.Point(16, 88)

        Me.radExclamation.Name = "radExclamation"

        Me.radExclamation.Size = New System.Drawing.Size(136, 24)

        Me.radExclamation.TabIndex = 2

        Me.radExclamation.Text = "Exclamation"

        '

        'radError

        '

        Me.radError.Location = New System.Drawing.Point(16, 48)

        Me.radError.Name = "radError"

        Me.radError.Size = New System.Drawing.Size(136, 24)

        Me.radError.TabIndex = 1

        Me.radError.Text = "Error"

        '

        'radAsterisk

        '

        Me.radAsterisk.Location = New System.Drawing.Point(16, 16)

        Me.radAsterisk.Name = "radAsterisk"

        Me.radAsterisk.Size = New System.Drawing.Size(136, 24)

        Me.radAsterisk.TabIndex = 0

        Me.radAsterisk.Text = "Asterisk"

        '

        'radYesNoCancel

        '

        Me.radYesNoCancel.Location = New System.Drawing.Point(16, 120)

        Me.radYesNoCancel.Name = "radYesNoCancel"

        Me.radYesNoCancel.Size = New System.Drawing.Size(120, 24)

        Me.radYesNoCancel.TabIndex = 3

        Me.radYesNoCancel.Text = "Yes/No/Cancel"

        '

        'radOk

        '

        Me.radOk.Location = New System.Drawing.Point(16, 24)

        Me.radOk.Name = "radOk"

        Me.radOk.Size = New System.Drawing.Size(112, 16)

        Me.radOk.TabIndex = 0

        Me.radOk.Text = "OK"

        '

        'cmdDisplay

        '

        Me.cmdDisplay.Location = New System.Drawing.Point(32, 240)

        Me.cmdDisplay.Name = "cmdDisplay"

        Me.cmdDisplay.Size = New System.Drawing.Size(112, 40)

        Me.cmdDisplay.TabIndex = 1

        Me.cmdDisplay.Text = "Display"

        '

        'lblDisplay

        '

        Me.lblDisplay.Location = New System.Drawing.Point(24, 296)

        Me.lblDisplay.Name = "lblDisplay"

        Me.lblDisplay.Size = New System.Drawing.Size(144, 24)

        Me.lblDisplay.TabIndex = 5

        '

        'buttonTypeGroupBox

        '

        Me.buttonTypeGroupBox.Controls.AddRange(New System.Windows.Forms.Control() {Me.radRetryCancel, Me.radYesNo, Me.radYesNoCancel, Me.radAbortRetryIgnore, Me.radOkCancel, Me.radOk})

        Me.buttonTypeGroupBox.Location = New System.Drawing.Point(16, 16)

        Me.buttonTypeGroupBox.Name = "buttonTypeGroupBox"

        Me.buttonTypeGroupBox.Size = New System.Drawing.Size(144, 216)

        Me.buttonTypeGroupBox.TabIndex = 2

        Me.buttonTypeGroupBox.TabStop = False

        Me.buttonTypeGroupBox.Text = "Button Type"

        '

        'radRetryCancel

        '

        Me.radRetryCancel.Location = New System.Drawing.Point(16, 192)

        Me.radRetryCancel.Name = "radRetryCancel"

        Me.radRetryCancel.Size = New System.Drawing.Size(104, 16)

        Me.radRetryCancel.TabIndex = 5

        Me.radRetryCancel.Text = "Retry/Cancel"

        '

        'radOkCancel

        '

        Me.radOkCancel.Location = New System.Drawing.Point(16, 56)

        Me.radOkCancel.Name = "radOkCancel"

        Me.radOkCancel.Size = New System.Drawing.Size(120, 24)

        Me.radOkCancel.TabIndex = 1

        Me.radOkCancel.Text = "OK/Cancel"

        '

        'FrmRadioButton

        '

        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

        Me.ClientSize = New System.Drawing.Size(384, 333)

        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblDisplay, Me.iconGroupBox, Me.buttonTypeGroupBox, Me.cmdDisplay})

        Me.Name = "FrmRadioButton"

        Me.Text = "RadioButtonTest"

        Me.iconGroupBox.ResumeLayout(False)

        Me.buttonTypeGroupBox.ResumeLayout(False)

        Me.ResumeLayout(False)

 

    End Sub

 

 

 

    ' display message box and obtain dialogue button clicked

    Private Sub cmdDisplay_Click(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles cmdDisplay.Click

 

        Dim dialog As DialogResult = MessageBox.Show( _

           "This is Your Custom MessageBox", "Custom MessageBox", _

           buttonType, iconType)

 

        Select Case dialog

 

            Case DialogResult.OK

                lblDisplay.Text = "OK was pressed"

 

            Case DialogResult.Cancel

                lblDisplay.Text = "Cancel was pressed"

 

            Case DialogResult.Abort

                lblDisplay.Text = "Abort was pressed"

 

            Case DialogResult.Retry

                lblDisplay.Text = "Retry was pressed"

 

            Case DialogResult.Ignore

                lblDisplay.Text = "Ignore was pressed"

 

            Case DialogResult.Yes

                lblDisplay.Text = "Yes was pressed"

 

            Case DialogResult.No

                lblDisplay.Text = "No was pressed"

        End Select

 

    End Sub

 

    Private Sub radOk_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radOk.CheckedChanged

 

        buttonType = MessageBoxButtons.OK

    End Sub

 

    Private Sub radOkCancel_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radOkCancel.CheckedChanged

 

        buttonType = MessageBoxButtons.OKCancel

    End Sub

 

    Private Sub radAbortRetryIgnore_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radAbortRetryIgnore.CheckedChanged

 

        buttonType = MessageBoxButtons.AbortRetryIgnore

    End Sub

 

    Private Sub radYesNoCancel_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radYesNoCancel.CheckedChanged

 

        buttonType = MessageBoxButtons.YesNoCancel

    End Sub

 

    Private Sub radYesNo_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radYesNo.CheckedChanged

 

        buttonType = MessageBoxButtons.YesNo

    End Sub

 

    Private Sub radRetryCancel_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radRetryCancel.CheckedChanged

 

        buttonType = MessageBoxButtons.RetryCancel

    End Sub

 

    Private Sub radAsterisk_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radAsterisk.CheckedChanged

 

        iconType = MessageBoxIcon.Asterisk

    End Sub

 

    Private Sub radError_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radError.CheckedChanged

 

        iconType = MessageBoxIcon.Error

    End Sub

 

    Private Sub radExclamation_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radExclamation.CheckedChanged

 

        iconType = MessageBoxIcon.Exclamation

    End Sub

 

    Private Sub radHand_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radHand.CheckedChanged

 

        iconType = MessageBoxIcon.Hand

    End Sub

 

    Private Sub radInformation_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radInformation.CheckedChanged

 

        iconType = MessageBoxIcon.Information

    End Sub

 

    Private Sub radQuestion_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radQuestion.CheckedChanged

 

        iconType = MessageBoxIcon.Question

    End Sub

 

    Private Sub radStop_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radStop.CheckedChanged

 

        iconType = MessageBoxIcon.Stop

    End Sub

 

    Private Sub radWarning_CheckedChanged(ByVal sender _

       As System.Object, ByVal e As System.EventArgs) _

       Handles radWarning.CheckedChanged

 

        iconType = MessageBoxIcon.Warning

    End Sub

 

 

End Class

Scrollbar ve rota:

Imports System

Imports System.Windows.Forms

Imports System.Drawing

Imports System.Drawing.Drawing2D

Imports System.Drawing.Text

Imports System.Drawing.Imaging

 

 

 

Public Class Form1

    Inherits System.Windows.Forms.Form

 

    Dim XlateY As Int32

    Dim Angle As Single

    Dim DrawingRect As Rectangle = New Rectangle(25, 25, 225, 225)

 

 

 

   

 

    Friend WithEvents xlate As System.Windows.Forms.VScrollBar

    Friend WithEvents rotate As System.Windows.Forms.HScrollBar

 

 

    Private Sub Form1_Load(ByVal sender As System.Object, _

                           ByVal e As System.EventArgs) _

                           Handles MyBase.Load

        Me.BackColor = Color.NavajoWhite

        Me.xlate = New System.Windows.Forms.VScrollBar()

        Me.rotate = New System.Windows.Forms.HScrollBar()

        Me.SuspendLayout()

        '

        'xlate

        '

        Me.xlate.Location = New System.Drawing.Point(264, 32)

        Me.xlate.Name = "xlate"

        Me.xlate.Size = New System.Drawing.Size(16, 200)

        Me.xlate.TabIndex = 0

        '

        'rotate

        '

        Me.rotate.Location = New System.Drawing.Point(8, 240)

        Me.rotate.Name = "rotate"

        Me.rotate.Size = New System.Drawing.Size(240, 16)

        Me.rotate.TabIndex = 1

        '

        'Form1

        '

        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

        Me.ClientSize = New System.Drawing.Size(292, 273)

        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.rotate, Me.xlate})

        Me.MaximizeBox = False

        Me.MinimizeBox = False

        Me.Name = "Form1"

        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen

        Me.Text = "Form1"

        Me.ResumeLayout(False)

 

 

 

 

 

    End Sub

 

    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)

        Dim G As Graphics = e.Graphics

 

        G.SmoothingMode = SmoothingMode.AntiAlias

 

        ' Create a graphics path, add a rectangle, set colors

        Dim Path As New GraphicsPath()

        Path.AddRectangle(New Rectangle(75, 100, 100, 75))

        Dim Pts As PointF() = Path.PathPoints

        Dim B As New PathGradientBrush(Pts)

 

        'translate the brush

        Dim m As New Matrix()

        m.Translate(0, XlateY, MatrixOrder.Append)

        m.RotateAt(Angle, B.CenterPoint, MatrixOrder.Append)

        B.MultiplyTransform(m, MatrixOrder.Append)

        G.FillRectangle(B, DrawingRect)

 

    End Sub

 

    Private Sub xlate_Scroll(ByVal sender As System.Object, _

                             ByVal e As System.Windows.Forms.ScrollEventArgs) _

                             Handles xlate.Scroll

 

        XlateY = xlate.Value

        Me.Invalidate(DrawingRect)

 

    End Sub

 

    Private Sub rotate_Scroll(ByVal sender As System.Object, _

                              ByVal e As System.Windows.Forms.ScrollEventArgs) _

                              Handles rotate.Scroll

 

        Angle = rotate.Value

        Me.Invalidate(DrawingRect)

 

    End Sub

End Class

Scrollbar örneği1:

Imports System.Windows.Forms

 

 

Public Class Form1

    Inherits System.Windows.Forms.Form

 

    Friend WithEvents HScrollBar1 As System.Windows.Forms.HScrollBar

    Friend WithEvents VScrollBar1 As System.Windows.Forms.VScrollBar

    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox

    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

        Me.HScrollBar1 = New System.Windows.Forms.HScrollBar()

        Me.VScrollBar1 = New System.Windows.Forms.VScrollBar()

        Me.TextBox1 = New System.Windows.Forms.TextBox()

        Me.TextBox2 = New System.Windows.Forms.TextBox()

        Me.SuspendLayout()

        '

        'HScrollBar1

        '

        Me.HScrollBar1.Location = New System.Drawing.Point(32, 112)

        Me.HScrollBar1.Maximum = 1000

        Me.HScrollBar1.Minimum = 1

        Me.HScrollBar1.Name = "HScrollBar1"

        Me.HScrollBar1.Size = New System.Drawing.Size(200, 13)

        Me.HScrollBar1.TabIndex = 0

        Me.HScrollBar1.Value = 1

        '

        'VScrollBar1

        '

        Me.VScrollBar1.LargeChange = 1

        Me.VScrollBar1.Location = New System.Drawing.Point(32, 16)

        Me.VScrollBar1.Minimum = 1

        Me.VScrollBar1.Name = "VScrollBar1"

        Me.VScrollBar1.TabIndex = 1

        Me.VScrollBar1.Value = 1

        '

        'TextBox1

        '

        Me.TextBox1.Location = New System.Drawing.Point(64, 24)

        Me.TextBox1.Name = "TextBox1"

        Me.TextBox1.TabIndex = 2

        Me.TextBox1.Text = ""

        '

        'TextBox2

        '

        Me.TextBox2.Location = New System.Drawing.Point(248, 112)

        Me.TextBox2.Name = "TextBox2"

        Me.TextBox2.TabIndex = 3

        Me.TextBox2.Text = ""

        '

        'Form1

        '

        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

        Me.ClientSize = New System.Drawing.Size(368, 165)

        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TextBox2, Me.TextBox1, Me.VScrollBar1, Me.HScrollBar1})

        Me.Name = "Form1"

        Me.Text = "ScrollBarDemo"

        Me.ResumeLayout(False)

 

    End Sub

 

 

 

    Private Sub VScrollBar1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles VScrollBar1.ValueChanged

        TextBox1.Text = VScrollBar1.Value

    End Sub

 

    Private Sub HScrollBar1_Scroll(ByVal sender As Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll

        TextBox2.Text = HScrollBar1.Value

    End Sub

 

 

End Class

 

 

 

Toolstrip taşınabilir:

 

Imports System

Imports System.Data

Imports System.Windows.Forms

Imports System.Drawing

Imports System.Data.SqlClient

 

 

 

Public Class Form1

    Inherits System.Windows.Forms.Form

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

        Me.ToolStripContainer1 = New System.Windows.Forms.ToolStripContainer

        Me.ToolStrip4 = New System.Windows.Forms.ToolStrip

        Me.ToolStripLabel4 = New System.Windows.Forms.ToolStripLabel

        Me.ToolStrip3 = New System.Windows.Forms.ToolStrip

        Me.ToolStripLabel3 = New System.Windows.Forms.ToolStripLabel

        Me.ToolStrip1 = New System.Windows.Forms.ToolStrip

        Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel

        Me.ToolStrip2 = New System.Windows.Forms.ToolStrip

        Me.ToolStripLabel2 = New System.Windows.Forms.ToolStripLabel

        Me.ToolStrip5 = New System.Windows.Forms.ToolStrip

        Me.ToolStripLabel5 = New System.Windows.Forms.ToolStripLabel

        Me.PictureBox1 = New System.Windows.Forms.PictureBox

        Me.ToolStripContainer1.BottomToolStripPanel.SuspendLayout()

        Me.ToolStripContainer1.ContentPanel.SuspendLayout()

        Me.ToolStripContainer1.RightToolStripPanel.SuspendLayout()

        Me.ToolStripContainer1.TopToolStripPanel.SuspendLayout()

        Me.ToolStripContainer1.SuspendLayout()

        Me.ToolStrip4.SuspendLayout()

        Me.ToolStrip3.SuspendLayout()

        Me.ToolStrip1.SuspendLayout()

        Me.ToolStrip2.SuspendLayout()

        Me.ToolStrip5.SuspendLayout()

        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()

        Me.SuspendLayout()

        '

        'ToolStripContainer1

        '

        '

        'ToolStripContainer1.BottomToolStripPanel

        '

        Me.ToolStripContainer1.BottomToolStripPanel.Controls.Add(Me.ToolStrip5)

        Me.ToolStripContainer1.BottomToolStripPanel.Controls.Add(Me.ToolStrip4)

        '

        'ToolStripContainer1.ContentPanel

        '

        Me.ToolStripContainer1.ContentPanel.Controls.Add(Me.PictureBox1)

        Me.ToolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill

        Me.ToolStripContainer1.Location = New System.Drawing.Point(0, 0)

        Me.ToolStripContainer1.Name = "ToolStripContainer1"

        '

        'ToolStripContainer1.RightToolStripPanel

        '

        Me.ToolStripContainer1.RightToolStripPanel.Controls.Add(Me.ToolStrip3)

        Me.ToolStripContainer1.Size = New System.Drawing.Size(292, 273)

        Me.ToolStripContainer1.TabIndex = 0

        Me.ToolStripContainer1.Text = "ToolStripContainer1"

        '

        'ToolStripContainer1.TopToolStripPanel

        '

        Me.ToolStripContainer1.TopToolStripPanel.Controls.Add(Me.ToolStrip1)

        Me.ToolStripContainer1.TopToolStripPanel.Controls.Add(Me.ToolStrip2)

        '

        'ToolStrip4

        '

        Me.ToolStrip4.Dock = System.Windows.Forms.DockStyle.None

        Me.ToolStrip4.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel4})

        Me.ToolStrip4.Location = New System.Drawing.Point(40, 0)

        Me.ToolStrip4.Name = "ToolStrip4"

        Me.ToolStrip4.Size = New System.Drawing.Size(78, 25)

        Me.ToolStrip4.TabIndex = 2

        Me.ToolStrip4.Text = "ToolStrip4"

        '

        'ToolStripLabel4

        '

        Me.ToolStripLabel4.Name = "ToolStripLabel4"

        Me.ToolStripLabel4.Text = "ToolStrip4"

        '

        'ToolStrip3

        '

        Me.ToolStrip3.Dock = System.Windows.Forms.DockStyle.None

        Me.ToolStrip3.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel3})

        Me.ToolStrip3.Location = New System.Drawing.Point(0, 25)

        Me.ToolStrip3.Name = "ToolStrip3"

        Me.ToolStrip3.Size = New System.Drawing.Size(25, 81)

        Me.ToolStrip3.TabIndex = 3

        Me.ToolStrip3.Text = "ToolStrip3"

        Me.ToolStrip3.TextDirection = System.Windows.Forms.ToolStripTextDirection.Vertical90

        '

        'ToolStripLabel3

        '

        Me.ToolStripLabel3.AutoSize = False

        Me.ToolStripLabel3.Name = "ToolStripLabel3"

        Me.ToolStripLabel3.Size = New System.Drawing.Size(25, 69)

        Me.ToolStripLabel3.Text = "ToolStrip3"

        '

        'ToolStrip1

        '

        Me.ToolStrip1.Dock = System.Windows.Forms.DockStyle.None

        Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1})

        Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)

        Me.ToolStrip1.Name = "ToolStrip1"

        Me.ToolStrip1.Size = New System.Drawing.Size(109, 25)

        Me.ToolStrip1.TabIndex = 0

        Me.ToolStrip1.Text = "ToolStrip1"

        '

        'ToolStripLabel1

        '

        Me.ToolStripLabel1.Name = "ToolStripLabel1"

        Me.ToolStripLabel1.Text = "ToolStrip1"

        '

        'ToolStrip2

        '

        Me.ToolStrip2.Dock = System.Windows.Forms.DockStyle.None

        Me.ToolStrip2.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel2})

        Me.ToolStrip2.Location = New System.Drawing.Point(183, 0)

        Me.ToolStrip2.Name = "ToolStrip2"

        Me.ToolStrip2.Size = New System.Drawing.Size(78, 25)

        Me.ToolStrip2.TabIndex = 1

        Me.ToolStrip2.Text = "ToolStrip2"

        '

        'ToolStripLabel2

        '

        Me.ToolStripLabel2.Name = "ToolStripLabel2"

        Me.ToolStripLabel2.Text = "ToolStrip2"

        '

        'ToolStrip5

        '

        Me.ToolStrip5.Dock = System.Windows.Forms.DockStyle.None

        Me.ToolStrip5.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel5})

        Me.ToolStrip5.Location = New System.Drawing.Point(168, 0)

        Me.ToolStrip5.Name = "ToolStrip5"

        Me.ToolStrip5.Size = New System.Drawing.Size(78, 25)

        Me.ToolStrip5.TabIndex = 3

        Me.ToolStrip5.Text = "ToolStrip5"

        '

        'ToolStripLabel5

        '

        Me.ToolStripLabel5.Name = "ToolStripLabel5"

        Me.ToolStripLabel5.Text = "ToolStrip5"

        '

        'PictureBox1

        '

        Me.PictureBox1.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(192, Byte), Integer))

        Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

        Me.PictureBox1.Dock = System.Windows.Forms.DockStyle.Fill

        Me.PictureBox1.Location = New System.Drawing.Point(0, 0)

        Me.PictureBox1.Name = "PictureBox1"

        Me.PictureBox1.Size = New System.Drawing.Size(267, 223)

        Me.PictureBox1.TabIndex = 0

        Me.PictureBox1.TabStop = False

        '

        'Form1

        '

        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

        Me.ClientSize = New System.Drawing.Size(292, 273)

        Me.Controls.Add(Me.ToolStripContainer1)

        Me.Name = "Form1"

        Me.Text = "UseToolStripContainer"

        Me.ToolStripContainer1.BottomToolStripPanel.ResumeLayout(False)

        Me.ToolStripContainer1.BottomToolStripPanel.PerformLayout()

        Me.ToolStripContainer1.ContentPanel.ResumeLayout(False)

        Me.ToolStripContainer1.RightToolStripPanel.ResumeLayout(False)

        Me.ToolStripContainer1.RightToolStripPanel.PerformLayout()

        Me.ToolStripContainer1.TopToolStripPanel.ResumeLayout(False)

        Me.ToolStripContainer1.TopToolStripPanel.PerformLayout()

        Me.ToolStripContainer1.ResumeLayout(False)

        Me.ToolStripContainer1.PerformLayout()

        Me.ToolStrip4.ResumeLayout(False)

        Me.ToolStrip3.ResumeLayout(False)

        Me.ToolStrip1.ResumeLayout(False)

        Me.ToolStrip2.ResumeLayout(False)

        Me.ToolStrip5.ResumeLayout(False)

        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()

        Me.ResumeLayout(False)

 

    End Sub

    Friend WithEvents ToolStripContainer1 As System.Windows.Forms.ToolStripContainer

    Friend WithEvents ToolStrip2 As System.Windows.Forms.ToolStrip

    Friend WithEvents ToolStripLabel2 As System.Windows.Forms.ToolStripLabel

    Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip

    Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel

    Friend WithEvents ToolStrip4 As System.Windows.Forms.ToolStrip

    Friend WithEvents ToolStripLabel4 As System.Windows.Forms.ToolStripLabel

    Friend WithEvents ToolStrip3 As System.Windows.Forms.ToolStrip

    Friend WithEvents ToolStripLabel3 As System.Windows.Forms.ToolStripLabel

    Friend WithEvents ToolStrip5 As System.Windows.Forms.ToolStrip

    Friend WithEvents ToolStripLabel5 As System.Windows.Forms.ToolStripLabel

    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox

 

 

End Class

 

 
Bu web sitesi ücretsiz olarak Bedava-Sitem.com ile oluşturulmuştur. Siz de kendi web sitenizi kurmak ister misiniz?
Ücretsiz kaydol