Hi,
I'm designing a graphical asset management program for the organisation I work for so that we can keep track of all the computers etc. we have in various buildings. I'm developing in VS2005 and was thinking that something like having a main map displayed in the centre and giving the user the ability to add and remove assets simply by clicking on it would be the best way.
As a little prototype, I'm using the following code to create new asset images (using a red circle as a test):
VB Code:
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As _ System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp Dim newpic As New PictureBox newpic.Image = System.Drawing.Image.FromFile _ ("red circle.bmp") newpic.SizeMode = PictureBoxSizeMode.AutoSize newpic.Left = e.X - newpic.Width / 2 newpic.Top = e.Y - newpic.Height / 2 Me.Controls.Add(newpic) End Sub
First off, this isn't ideal as there's no transparency, so the circle appears with its bounding white square. Secondly, what's the best way to capture the click event? You can't declare an array WithEvents, which would be a problem as there are going to be a lot of these things.
Any ideas?




Reply With Quote