|
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.
|
|
|
|
|
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[^].
|
|
|
|
|
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>]
|
|
|
|
|
It's a very brief overview, but it's a decent place to start.
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
|
Hi,
Another problem of mine.
I run a process(say a calculator) from a button click. Now I want to resume(do nothing/disable) the form till the user finishes the process ie till he closes the calculator.
I am using waitforexit like below(not the exact code)
dim p as new process
p.startinfo="calc"
p.waitforexit()
p.start()
It works fine,.But sometime it gives an error in the line(p.waiforexit) saying that p has not been allocated any process (not the exact error, but with similar measning)
Please help me
Thanks in advance
|
|
|
|
|
This is because your Waiting for the process to exist before you start the process! You can't wait for something to exit if it doesn't exist yet! Switch those two lines around and it'll work.
|
|
|
|
|
thanks for your reply
i think u r mistaking me.
its waitforexit not exist...
|
|
|
|
|
himangshu123 wrote: i think u r mistaking me.
No but you are mistaking him.
Dave Kreskowiak correctly pointed out that your code waits for exit before it starts. It should start and then wait for exit;
p.waitforexit()
p.start()
switch those two lines round then all should be well.
Incidentally in your OP you stated that the code you posted was not the exact code, and the error message was not the exact error message. In this case it doesn't seem to have made any difference, but you really should (particularly for error messages), give the exact wording.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
oh apologise me...
my mistake...
actually I have done the same...i didnt cut copy the code so that mistake came...sorry...
please help me
|
|
|
|
|
|
sorry....
code is
dim p as new process
p.startinfo="calc"
p.start()
p.waitforexit()
this was my actual code
still the problem arise
|
|
|
|
|
Next time, copy and paste the code. Don't retype it from memory. You'll get the order of statements wrong and quite possibly not convey some minor detail that makes all the difference to whether your code runs or not.
Between the call to .Start and .WaitForExit, add the line p.WaitForInputIdle() . This will force your code to wait for the app to start.
|
|
|
|
|
Hi to All,
Here is an another problem of mine.I am using vb.net2005.
I want to maximize the form so that user can not access the taskBar. I got some code,to hide the windows task bar. But when I run another process(say calculator) from my application, the taskbar reappears.
So I was wondering if any method or property is there to maximize the form so that, the form comes top of the task bar itself....
Please suggest a way
Thanks in advance
|
|
|
|
|
|
hi to all
Could anyone please tell me how to block certain drives to be accessed while looking for sub directories and files.
(All I want is to give an environment to the user so that HE CAN LOOK FOR FILES IN A DIRECORY, WHICH ALSO MAY HAVE SUBDIRECTORIES). The tool I am using is dirListBox in vb.net2005.
But my problem is that user can go to all the files and directories in the computer. (i WANT HIIM TO ACCESS THE FILES AND FOLDER OF A SPECIFIED DIRECTORY ONLY, SAY INSIDE C:\AA)..
NOW HOW TO FILTER THE DIRLISTBOX,?
please advice me if any other method is there for the same...(not necessary to be the DirListBox control)
THNAKS IN ADVANCE
|
|
|
|
|
himangshu123 wrote: The tool I am using is dirListBox in vb.net2005.
There is no "DirListBox" in VB.NET. Are you talking about the OpenFileDialog or are you using the old DirListBox from the VB6 days?? The old DirListBox could not be filtered or limited to a group of folders.
|
|
|
|
|
thanks for the reply
ok can openfiledialog be make to show or start from a particular directory? User shouldnot be able to view others
|
|
|
|
|
Have a read through the members of OpenFileDialog, in the MSDN documentation. It should be fairly easy to find the correct solution.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
The OpenFileDialog class is a wrapper to call the Win32 function OpenFile (? I can't remember which the function name exactly!). Win32 displays the dialog, not the .NET class OpenFileDialog.
OpenFileDialog is also a sealed (NotInheritable) class, so you can't really modify it at all. You can't even get the window handle to the dialog and start throwing messages at it since your code stops running when you call the dialogs .ShowDialog method.
Your going to have to write your own dialog to support this. It would just be a simple Form with a TreeView for a directory browser, and a ListView for files in the currently selected directory. Oh, and of course, a couple of buttons for Open and Cancel.
|
|
|
|
|
Hello every one,
I am having a VB.net 2005 application.
Earlier we had designed the application with a fixed window size, now we had implemented TableLayoutPanel in it to make it full screen.
After the implementation I made Windowstate as maximized for the forms. Now I am encountering some thing strange,
On formName.show first the form1_activate is executed instead of form1_load.
(Openinf form1 from form)
Once I reverted back “Windowstate to Normal” the execution sequence comes back to normal (Lode and then execute)
Can any one plz help me out with it...
Regards
Nishkarsh
|
|
|
|