Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. placing a control on the panel

placing a control on the panel

Scheduled Pinned Locked Moved Visual Basic
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lavankumar
    wrote on last edited by
    #1

    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.

    C E V 3 Replies Last reply
    0
    • L lavankumar

      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.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • L lavankumar

        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.

        E Offline
        E Offline
        Enver Maroshi
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • L lavankumar

          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.

          V Offline
          V Offline
          vijaylumar
          wrote on last edited by
          #4

          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...

          C 1 Reply Last reply
          0
          • V vijaylumar

            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...

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • E Enver Maroshi

              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.

              L Offline
              L Offline
              lavankumar
              wrote on last edited by
              #6

              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

              E 1 Reply Last reply
              0
              • L lavankumar

                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

                E Offline
                E Offline
                Enver Maroshi
                wrote on last edited by
                #7

                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.

                L 1 Reply Last reply
                0
                • E Enver Maroshi

                  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.

                  L Offline
                  L Offline
                  lavankumar
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups