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. Set Property of Read-Only to be False on Form

Set Property of Read-Only to be False on Form

Scheduled Pinned Locked Moved Visual Basic
help
10 Posts 3 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.
  • Y Offline
    Y Offline
    ymilan
    wrote on last edited by
    #1

    Hello, I created a form in designer view with image bitmaps on them.   I cannot do much in my code according to the compiler error that I have the images as read-only. None of the images can be set to a value of image; windows.systems.forms.bitmaps doesn't allow it. Any help on how I can make the form write and read or parts of the form, like the images that I want to move on the form would be appreciated. Thank you in advance.

    D T 2 Replies Last reply
    0
    • Y ymilan

      Hello, I created a form in designer view with image bitmaps on them.   I cannot do much in my code according to the compiler error that I have the images as read-only. None of the images can be set to a value of image; windows.systems.forms.bitmaps doesn't allow it. Any help on how I can make the form write and read or parts of the form, like the images that I want to move on the form would be appreciated. Thank you in advance.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Your description makes no sense at all. I have no idea what controls and properties you're talking about that are "ReadOnly". If you ran your project and then went back to Visual Studio to make changes, and your app is still running, then, yes, nearly everything is going to be ReadOnly. You have to stop the app first, then make the changes in the designer.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      Y 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Your description makes no sense at all. I have no idea what controls and properties you're talking about that are "ReadOnly". If you ran your project and then went back to Visual Studio to make changes, and your app is still running, then, yes, nearly everything is going to be ReadOnly. You have to stop the app first, then make the changes in the designer.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        Y Offline
        Y Offline
        ymilan
        wrote on last edited by
        #3

        I did stop the app and looked in designer view, but there is no attribute I can set for the property of the form to be writable.   Basically, I'm trying to move images on one part of the screen to the top of other images on the other side of the screen, in a drag drop operation.   It doesn't work as I thought; I read several tutorials and tried different code, but nothing seems to move on the form at run-time. I hope this is a better explanation.

        D 1 Reply Last reply
        0
        • Y ymilan

          I did stop the app and looked in designer view, but there is no attribute I can set for the property of the form to be writable.   Basically, I'm trying to move images on one part of the screen to the top of other images on the other side of the screen, in a drag drop operation.   It doesn't work as I thought; I read several tutorials and tried different code, but nothing seems to move on the form at run-time. I hope this is a better explanation.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          ymilan wrote:

          I did stop the app and looked in designer view, but there is no attribute I can set for the property of the form to be writable.

          There is no such property. All of the controls on a form are static, meaning, you cannot move them around with the mouse. YOU have to provide the code that will handle what happens when the user holds the mouse down on a control and moves the mouse around. This is not going to be a trivial task for a beginner. It requires in depth knowledge of how controls and mouse events work. I wrote up an article on how to do this very thing with Label controls. You can read it here[^].

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          Y 2 Replies Last reply
          0
          • D Dave Kreskowiak

            ymilan wrote:

            I did stop the app and looked in designer view, but there is no attribute I can set for the property of the form to be writable.

            There is no such property. All of the controls on a form are static, meaning, you cannot move them around with the mouse. YOU have to provide the code that will handle what happens when the user holds the mouse down on a control and moves the mouse around. This is not going to be a trivial task for a beginner. It requires in depth knowledge of how controls and mouse events work. I wrote up an article on how to do this very thing with Label controls. You can read it here[^].

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            Y Offline
            Y Offline
            ymilan
            wrote on last edited by
            #5

            So there is no way to just set the form to be writable off the bat? I tried several mouseover, mousemove events that I found on net tutorials.   None of them worked.   HEre is code I have so far. Private Sub Image1_DragEnter(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DragEventArgs) _ Handles Image1.DragEnter             Dim Button As Short             If (e.Data.GetDataPresent(DataFormats.Bitmap)) Then                   If (Button = VB6.MouseButtonConstants.LeftButton) Then   e.Effect = DragDropEffects.Copy             Else                   e.Effect = DragDropEffects.Move             End If       End Sub       'Private Sub Hearts_DragDrop(ByVal sender As Object, _       'ByVal e As System.Windows.Forms.DragEventArgs) _       'Handles Hearts.DragDrop       'Hearts.Item = e.Data.GetData(DataFormats.Bitmap)       'End Sub       Private Sub Hearts_DragOver(ByVal sender As Object, _       ByVal e As System.Windows.Forms.DragEventArgs) _       Handles Hearts.DragOver       End Sub       Private Sub Clubs_DragOver(ByVal sender As Object, _       ByVal e As System.Windows.Forms.DragEventArgs) _       Handles Clubs.DragOver       End Sub       Private Sub Hearts_DragLeave(ByVal sender As Object, _       ByVal e As System.EventArgs) _       Handles Hearts.DragLeave       End Sub       Private Sub Clubs_DragLeave(ByVal sender As Object, _       ByVal e As System.EventArgs) _       Handles Clubs.DragLeave Sorry I'm a newbie, but I'm really trying....much appreciation in advance.

            Y D 2 Replies Last reply
            0
            • Y ymilan

              So there is no way to just set the form to be writable off the bat? I tried several mouseover, mousemove events that I found on net tutorials.   None of them worked.   HEre is code I have so far. Private Sub Image1_DragEnter(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DragEventArgs) _ Handles Image1.DragEnter             Dim Button As Short             If (e.Data.GetDataPresent(DataFormats.Bitmap)) Then                   If (Button = VB6.MouseButtonConstants.LeftButton) Then   e.Effect = DragDropEffects.Copy             Else                   e.Effect = DragDropEffects.Move             End If       End Sub       'Private Sub Hearts_DragDrop(ByVal sender As Object, _       'ByVal e As System.Windows.Forms.DragEventArgs) _       'Handles Hearts.DragDrop       'Hearts.Item = e.Data.GetData(DataFormats.Bitmap)       'End Sub       Private Sub Hearts_DragOver(ByVal sender As Object, _       ByVal e As System.Windows.Forms.DragEventArgs) _       Handles Hearts.DragOver       End Sub       Private Sub Clubs_DragOver(ByVal sender As Object, _       ByVal e As System.Windows.Forms.DragEventArgs) _       Handles Clubs.DragOver       End Sub       Private Sub Hearts_DragLeave(ByVal sender As Object, _       ByVal e As System.EventArgs) _       Handles Hearts.DragLeave       End Sub       Private Sub Clubs_DragLeave(ByVal sender As Object, _       ByVal e As System.EventArgs) _       Handles Clubs.DragLeave Sorry I'm a newbie, but I'm really trying....much appreciation in advance.

              Y Offline
              Y Offline
              ymilan
              wrote on last edited by
              #6

              Would this be a sound article to study? <a href="http://www.startvbdotnet.com/forms/mouse.aspx">http://www.startvbdotnet.com/forms/mouse.aspx</a>[<a href="http://www.startvbdotnet.com/forms/mouse.aspx" target="_blank" title="New Window">^</a>]

              D 1 Reply Last reply
              0
              • Y ymilan

                Would this be a sound article to study? <a href="http://www.startvbdotnet.com/forms/mouse.aspx">http://www.startvbdotnet.com/forms/mouse.aspx</a>[<a href="http://www.startvbdotnet.com/forms/mouse.aspx" target="_blank" title="New Window">^</a>]

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                It's a very brief overview, but it's a decent place to start.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                1 Reply Last reply
                0
                • Y ymilan

                  So there is no way to just set the form to be writable off the bat? I tried several mouseover, mousemove events that I found on net tutorials.   None of them worked.   HEre is code I have so far. Private Sub Image1_DragEnter(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DragEventArgs) _ Handles Image1.DragEnter             Dim Button As Short             If (e.Data.GetDataPresent(DataFormats.Bitmap)) Then                   If (Button = VB6.MouseButtonConstants.LeftButton) Then   e.Effect = DragDropEffects.Copy             Else                   e.Effect = DragDropEffects.Move             End If       End Sub       'Private Sub Hearts_DragDrop(ByVal sender As Object, _       'ByVal e As System.Windows.Forms.DragEventArgs) _       'Handles Hearts.DragDrop       'Hearts.Item = e.Data.GetData(DataFormats.Bitmap)       'End Sub       Private Sub Hearts_DragOver(ByVal sender As Object, _       ByVal e As System.Windows.Forms.DragEventArgs) _       Handles Hearts.DragOver       End Sub       Private Sub Clubs_DragOver(ByVal sender As Object, _       ByVal e As System.Windows.Forms.DragEventArgs) _       Handles Clubs.DragOver       End Sub       Private Sub Hearts_DragLeave(ByVal sender As Object, _       ByVal e As System.EventArgs) _       Handles Hearts.DragLeave       End Sub       Private Sub Clubs_DragLeave(ByVal sender As Object, _       ByVal e As System.EventArgs) _       Handles Clubs.DragLeave Sorry I'm a newbie, but I'm really trying....much appreciation in advance.

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  ymilan wrote:

                  So there is no way to just set the form to be writable off the bat?

                  There is simply no such thing. If you want to move controls around on the form at run-time, you have to write the code that provides such functionality. It is NOT built into the Form, nor anywhere else in the .NET Framework.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    ymilan wrote:

                    I did stop the app and looked in designer view, but there is no attribute I can set for the property of the form to be writable.

                    There is no such property. All of the controls on a form are static, meaning, you cannot move them around with the mouse. YOU have to provide the code that will handle what happens when the user holds the mouse down on a control and moves the mouse around. This is not going to be a trivial task for a beginner. It requires in depth knowledge of how controls and mouse events work. I wrote up an article on how to do this very thing with Label controls. You can read it here[^].

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    Y Offline
                    Y Offline
                    ymilan
                    wrote on last edited by
                    #9

                    Ok, now I've read many tutorials and examples of mousemove, dragenter, and dragover.   The main problem right now that I'm having is I'm trying to move a picturebox array.   I keep getting compiler errors that value of type system.drawing.image is not a valid member or type of picturebox array. I've looked up on MSDN the properties of pictureboxarray and it does show dragenter, dragover, and mousemove. However, I'm not finding any examples of how I can use the picturebox array to move the images I have on design view. In VB6, all I had to do is set oledragdrop to true and it worked. Any ideas on where or how I should accomplish this is much appreciated. Hopefully I'm explaining a little bit better now.   Thank you for your expertise.

                    1 Reply Last reply
                    0
                    • Y ymilan

                      Hello, I created a form in designer view with image bitmaps on them.   I cannot do much in my code according to the compiler error that I have the images as read-only. None of the images can be set to a value of image; windows.systems.forms.bitmaps doesn't allow it. Any help on how I can make the form write and read or parts of the form, like the images that I want to move on the form would be appreciated. Thank you in advance.

                      T Offline
                      T Offline
                      Tiyani Miyambo
                      wrote on last edited by
                      #10

                      you could try to use pecture box. me.picturebox.image = directry of the image, play around on how to justify the size of the image to fit in the piturebox

                      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