|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionIt is often a good idea to add irregular buttons to an application. This may be achieved by combining the use of BackgroundI needed to plot city boundaries using VB.NET and I needed to make the plot interactive. The users would click on a city and the application should display information about that city. This led me to use Using the codeThere are two forms in the project. Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim H(3) As Point
Dim J As New Kring()
' make a square polygon
H(0) = New Point(100, 100)
H(1) = New Point(300, 100)
H(2) = New Point(300, 400)
H(3) = New Point(100, 400)
'you can create a complex set of points
J.KKline = H
' I don't know how to set the fillbrush during design time so just
' specify other attributes via code
J.FillBrush = New SolidBrush(Color.Blue)
' it is important that the objects size be equal to
' the canvas or this in this case the form.
' the canvas may also be a picturebox or other windows control
' example :
' Picturebox1.controls.add(J)
' j.size = picturebox1.size
J.Size = Me.Size
Me.Controls.Add(J)
End Sub
Points of InterestI'm looking at developing a much faster and effective way to display clickable shapes. I've already used the same method (just applied geodetic formulas) to plot building footprints, road networks, and parcel vectors. But I cannot share those codes because they're my company properties.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||