placing a control on the panel
-
hi, i have a panel ,when i move the cursor on to the panel,i should get the cursor position i want to know the location of the cursor and place a control on the panel.
-
hi, i have a panel ,when i move the cursor on to the panel,i should get the cursor position i want to know the location of the cursor and place a control on the panel.
Which part are you stuck on ? Capture the mouse move event, then work from there.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
hi, i have a panel ,when i move the cursor on to the panel,i should get the cursor position i want to know the location of the cursor and place a control on the panel.
Double click panel, choose mouse move event and click on it and you will get somethign like this Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove ' e.X and e.Y are available End Sub To add control inside use something like this Dim NewBox As New TextBox NewBox.Location = New System.Drawing.Point(e.X, e.Y) Panel1.Controls.Add(NewBox) Just put this add control stuff into mouse up or something, or add it on mouse down, move control as you move mouse and release it on mouse up This is basic stuff, try to read a book or two.
-
hi, i have a panel ,when i move the cursor on to the panel,i should get the cursor position i want to know the location of the cursor and place a control on the panel.
hi i too have the same problem but the problem is like this i have two picture boxes and a panel. one picture box has a image and another picture box image is none. i can drag and drop the picturebox1 image onto the picturebox2 now i did the same drag and drop to panel with slight change if i drag and drop picturebox1 image on to the panel at any place on the panel then at that location i should add the picturebox1 control please any one can help i think i m confused and didnt explained u clearly...
-
hi i too have the same problem but the problem is like this i have two picture boxes and a panel. one picture box has a image and another picture box image is none. i can drag and drop the picturebox1 image onto the picturebox2 now i did the same drag and drop to panel with slight change if i drag and drop picturebox1 image on to the panel at any place on the panel then at that location i should add the picturebox1 control please any one can help i think i m confused and didnt explained u clearly...
This sort of code is almost always improved by dropping the picture boxes and instead writing your own code to put the images on your form, where you want them.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
Double click panel, choose mouse move event and click on it and you will get somethign like this Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove ' e.X and e.Y are available End Sub To add control inside use something like this Dim NewBox As New TextBox NewBox.Location = New System.Drawing.Point(e.X, e.Y) Panel1.Controls.Add(NewBox) Just put this add control stuff into mouse up or something, or add it on mouse down, move control as you move mouse and release it on mouse up This is basic stuff, try to read a book or two.
I can added images on panel where ever i want.But now problem is one image is overriding other image .i don't want to be override .
modified on Saturday, June 27, 2009 1:58 AM
-
I can added images on panel where ever i want.But now problem is one image is overriding other image .i don't want to be override .
modified on Saturday, June 27, 2009 1:58 AM
What exactly do you try to make? What is a role of this application? Maybe there is some other control that suites you better, if you need to drag-and-drop images, why not do it in listview? There you would be able to drop images, also to re-arange them, make a preview of them, etc... "But now problem is one image is overriding other image .i don't want to be override ." Well, then you would need colision detection :confused: What should happen next? If you try to release image on other existign one? Should cancel drop, or maybe move next to picture? Best you could do is loop through each image in panel and see if they positions match at any point.
-
What exactly do you try to make? What is a role of this application? Maybe there is some other control that suites you better, if you need to drag-and-drop images, why not do it in listview? There you would be able to drop images, also to re-arange them, make a preview of them, etc... "But now problem is one image is overriding other image .i don't want to be override ." Well, then you would need colision detection :confused: What should happen next? If you try to release image on other existign one? Should cancel drop, or maybe move next to picture? Best you could do is loop through each image in panel and see if they positions match at any point.
we are developing Logistics application.we have to drag and drop different types of images and should not overrides each other . what is solution for this problem. adv thank's lavan