Set Property of Read-Only to be False on Form
-
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.
-
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.
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 -
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, 2008I 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.
-
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.
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 -
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, 2008So 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.
-
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.
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>]
-
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>]
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 -
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.
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 -
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, 2008Ok, 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.
-
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.
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