ชุมชนคนรักภาษาเบสิค - Visual Basic Community

 ลืมรหัสผ่าน
 ลงทะเบียน
ค้นหา
ดู: 3454|ตอบกลับ: 1

[VB.NET] แจกโค้ดฟรีการทำ Tile Layout ของฟรีจากค่าย Syncfusion

[คัดลอกลิงก์]

311

กระทู้

502

โพสต์

6072

เครดิต

ผู้ดูแลระบบ

ทองก้อน ทับทิมกรอบ

Rank: 9Rank: 9Rank: 9

เครดิต
6072




ไม่พูดเยอะ เจ็บคอ ... ศึกษาดูวิธีการทำได้จากโค้ดเลยครับผม ... ดาวน์โหลด Syncfusion Community ได้ฟรีที่ Syncfusion Essential รุ่น Community

มาดูโค้ดกันเถอะ ...
  1. ' / --------------------------------------------------------------------------------
  2. ' / Developer : Mr.Surapon Yodsanga (Thongkorn Tubtimkrob)
  3. ' / eMail : thongkorn@hotmail.com
  4. ' / URL: http://www.g2gnet.com/webboard (Khon Kaen - Thailand)
  5. ' / Facebook: https://www.facebook.com/g2gnet (For Thailand)
  6. ' / Facebook: https://www.facebook.com/CommonIndy (Worldwide)
  7. ' / Purpose: Test TileLayout in Syncfusion Community with VB2010
  8. ' /
  9. ' / This is open source code under @Copyleft by Thongkorn Tubtimkrob.
  10. ' / You can modify and/or distribute without to inform the developer.
  11. ' / --------------------------------------------------------------------------------

  12. Imports Syncfusion.Windows.Forms

  13. Public Class frmTileLayout
  14.     Dim MyToolTip As ToolTipAdv = Nothing
  15.     Dim MySize As Size

  16.     Public Sub New()
  17.         ' This call is required by the designer.
  18.         InitializeComponent()
  19.         ' Add any initialization after the InitializeComponent() call.
  20.         ' Instantiate a ToolTipAdv
  21.         MyToolTip = New ToolTipAdv(Me)
  22.     End Sub

  23.     ' / --------------------------------------------------------------------------------
  24.     '// Sample Click Event and Driven in Visual Basic.
  25.     Private Sub ImageStreamer1_Click(sender As System.Object, e As System.EventArgs) Handles ImageStreamer1.Click
  26.         System.Diagnostics.Process.Start("C:\")
  27.     End Sub

  28.     Private Sub frmTileLayout_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
  29.         Me.Dispose()
  30.         Application.Exit()
  31.     End Sub

  32.     ' / --------------------------------------------------------------------------------
  33.     Private Sub frmTileLayout_Load(sender As Object, e As System.EventArgs) Handles Me.Load
  34.         Me.TileLayout1.Text = "I love Visual Basic"
  35.         Me.TileLayout1.ForeColor = Color.White

  36.         '// imageStremaer1
  37.         With Me.ImageStreamer1
  38.             '// Images for slide
  39.             .Images.Add(Image.FromFile(strPathImages + "\1.png"))
  40.             .Images.Add(Image.FromFile(strPathImages + "\2.png"))
  41.             .Images.Add(Image.FromFile(strPathImages + "\3.png"))
  42.             .AllowDragging = True
  43.             .TabIndex = 0
  44.             .SubText.Text = "Slider Sample"
  45.             .SubText.Location = New Point(0, .Height - (MySize.Height + 15))
  46.             .SubText.Visible = True
  47.             .Text = "Slider Sample"
  48.             '// Open Slide
  49.             .SlideShow = True
  50.             .SliderSpeed = 2000    ' 1000 millisecond = 1 second.
  51.         End With

  52.         '// imageStremaer2
  53.         With Me.ImageStreamer2
  54.             .Images.Add(Image.FromFile(strPathImages + "\c.png"))
  55.             .AllowDragging = True
  56.             .InternalBackColor = System.Drawing.Color.Yellow
  57.             .Location = New System.Drawing.Point(130, 0)
  58.             .Name = "imageStreamer2"
  59.             .Size = New System.Drawing.Size(120, 120)
  60.             .TabIndex = 1
  61.             .Text = "imageStreamer2"
  62.             .TextAnimationDirection = Syncfusion.Windows.Forms.Tools.ImageStreamer.TextStreamDirection.RightToLeft
  63.         End With

  64.         '// imageStreamer3
  65.         With Me.ImageStreamer3
  66.             .Images.Add(Image.FromFile(strPathImages + "\Syncfusion.jpg"))
  67.             .AllowDragging = True
  68.             .InternalBackColor = System.Drawing.Color.Red
  69.             .Location = New System.Drawing.Point(5, 125)
  70.             .Name = "imageStreamer3"
  71.             .Size = New System.Drawing.Size(120, 120)
  72.             .TabIndex = 2
  73.             .Text = "imageStreamer3"
  74.             .TextAnimationDirection = Syncfusion.Windows.Forms.Tools.ImageStreamer.TextStreamDirection.RightToLeft
  75.         End With

  76.         '//imageStreamer4
  77.         With Me.ImageStreamer4
  78.             .Images.Add(Image.FromFile(strPathImages + "\6.png"))
  79.             .SubText.Text = "Music"
  80.             .SubText.Visible = True
  81.             .BackColor = Color.DarkMagenta
  82.             .SubText.Location = New Point(0, .Height - (MySize.Height + 15))
  83.             .TabIndex = 3
  84.             '// Add Event Handler
  85.             AddHandler ImageStreamer4.Click, AddressOf ImageStreamer4_Click
  86.         End With

  87.         '//
  88.         With Me.ImageStreamer5
  89.             .Images.Add(Image.FromFile(strPathImages + "\g.png"))
  90.             .BackColor = Color.CadetBlue
  91.             .SubText.Text = "Sample Text"
  92.             .SubText.ForeColor = Color.Black
  93.             MySize = TextRenderer.MeasureText(ImageStreamer5.SubText.Text, Me.Font)
  94.             .SubText.Location = New Point(0, .Height - (MySize.Height + 5))
  95.         End With

  96.         '// Exit
  97.         Me.pictureBox1.Image = Image.FromFile(strPathImages + "\Exit.png")

  98.     End Sub

  99.     Private Sub ImageStreamer4_Click(sender As Object, e As System.EventArgs)
  100.         Dim myMusicPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)
  101.         System.Diagnostics.Process.Start(myMusicPath)
  102.     End Sub

  103.     Private Sub pictureBox1_Click(sender As Object, e As System.EventArgs) Handles pictureBox1.Click
  104.         Me.Dispose()
  105.     End Sub

  106.     Private Sub pictureBox1_MouseEnter(sender As Object, e As System.EventArgs) Handles pictureBox1.MouseEnter
  107.         Me.Cursor = Cursors.Hand
  108.         Dim pt As Point = Me.PointToScreen(New Point(Me.pictureBox1.Bounds.X + 10, Me.pictureBox1.Bounds.Y + Me.pictureBox1.Height + 10))
  109.         Me.MyToolTip.Text = "Close"
  110.         Me.MyToolTip.ShowPopup(pt)
  111.     End Sub

  112.     Private Sub pictureBox1_MouseLeave(sender As Object, e As System.EventArgs) Handles pictureBox1.MouseLeave
  113.         Me.Cursor = Cursors.Default
  114.         Me.MyToolTip.HidePopup()
  115.     End Sub

  116.     Private Sub ImageStreamer3_Click(sender As System.Object, e As System.EventArgs) Handles ImageStreamer3.Click
  117.         Process.Start("http://www.syncfusion.com/downloads/latest-version")
  118.     End Sub

  119. End Class
คัดลอกไปที่คลิปบอร์ด


โมดูลหากินอีกแล้ว modFunction.vb ...
  1. ' / --------------------------------------------------------------------------------
  2. ' / Developer : Mr.Surapon Yodsanga (Thongkorn Tubtimkrob)
  3. ' / eMail : thongkorn@hotmail.com
  4. ' / URL: http://www.g2gnet.com (Khon Kaen - Thailand)
  5. ' / Facebook: https://www.facebook.com/g2gnet (For Thailand)
  6. ' / Facebook: https://www.facebook.com/commonindy (Worldwide)
  7. ' / Microsoft Visual Basic .NET (2010)
  8. ' /
  9. ' / This is open source code under @Copyleft by Thongkorn Tubtimkrob.
  10. ' / You can modify and/or distribute without to inform the developer.
  11. ' / --------------------------------------------------------------------------------
  12. Imports Microsoft.VisualBasic
  13. Module modFunction
  14.     '// Images Path
  15.     Public strPathImages As String = MyPath(Application.StartupPath) & "Images"

  16.     ' / --------------------------------------------------------------------------------
  17.     ' / Get my project path
  18.     ' / AppPath = C:\My Project\bin\debug
  19.     ' / Replace "\bin\debug" with ""
  20.     ' / Return : C:\My Project\
  21.     Function MyPath(AppPath As String) As String
  22.         '/ MessageBox.Show(AppPath);
  23.         AppPath = AppPath.ToLower()
  24.         '/ Return Value
  25.         MyPath = AppPath.Replace("\bin\debug", "").Replace("\bin\release", "").Replace("\bin\x86\debug", "")
  26.         '// If not found folder then put the \ (BackSlash) at the end.
  27.         If Right(MyPath, 1) <> "" Then MyPath = MyPath & ""
  28.     End Function

  29. End Module
คัดลอกไปที่คลิปบอร์ด

ดาวน์โหลดโค้ดฉบับเต็ม VB.NET (2010) ได้ที่นี่ ...

ขออภัย! โพสต์นี้มีไฟล์แนบหรือรูปภาพที่ไม่ได้รับอนุญาตให้คุณเข้าถึง

คุณจำเป็นต้อง ลงชื่อเข้าใช้ เพื่อดาวน์โหลดหรือดูไฟล์แนบนี้ คุณยังไม่มีบัญชีใช่ไหม? ลงทะเบียน

x
สิ่งที่ดีกว่าการให้ คือการให้แบบไม่มีที่สิ้นสุด

0

กระทู้

5

โพสต์

83

เครดิต

Member

Rank: 2

เครดิต
83
โพสต์ 2019-2-2 07:43:40 | ดูโพสต์ทั้งหมด

ขอบคุณครับ

0

กระทู้

2

โพสต์

51

เครดิต

Member

Rank: 2

เครดิต
51
โพสต์ 2019-2-8 21:38:55 | ดูโพสต์ทั้งหมด

ขอบคุณครับ
ขออภัย! คุณไม่ได้รับสิทธิ์ในการดำเนินการในส่วนนี้ กรุณาเลือกอย่างใดอย่างหนึ่ง ลงชื่อเข้าใช้ | ลงทะเบียน

รายละเอียดเครดิต

ข้อความล้วน|อุปกรณ์พกพา|ประวัติการแบน|G2GNet.com  

GMT+7, 2024-5-5 23:41 , Processed in 0.291590 second(s), 4 queries , File On.

Powered by Discuz! X3.4, Rev.62

Copyright © 2001-2020 Tencent Cloud.

ตอบกระทู้ ขึ้นไปด้านบน ไปที่หน้ารายการกระทู้