Form background

278 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
278
On SlideShare
0
From Embeds
0
Number of Embeds
39
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Form background

  1. 1. Form-ийн дэвсгэр зураг болон зургийн байрлалыг өөрчлөхҮүний тулд нэг Button, 5 Radio button мөн OpenFileDialog хэрэгтэй.Зураг солих товчинд дараах кодыг оруул.Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click Dim OpenFileDialog1 As New OpenFileDialog With OpenFileDialog1 .CheckFileExists = True .ShowReadOnly = False .Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg" .FilterIndex = 2 If .ShowDialog = DialogResult.OK Then Me.BackgroundImage = Image.FromFile(.FileName) End If End WithEnd SubМөн Radio button тус бүр дээр кодуудыг оруулна.Tile radio button:Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles RadioButton1.CheckedChanged Me.BackgroundImageLayout = ImageLayout.TileEnd Sub
  2. 2. Center radio button:Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles RadioButton2.CheckedChanged Me.BackgroundImageLayout = ImageLayout.CenterEnd SubStretch radio button:Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles RadioButton3.CheckedChanged Me.BackgroundImageLayout = ImageLayout.StretchEnd SubZoom radio button:Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles RadioButton4.CheckedChanged Me.BackgroundImageLayout = ImageLayout.ZoomEnd SubЗураг устгах radio button:Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles RadioButton5.CheckedChanged Me.BackgroundImage = NothingEnd Sub

×