|
That error is thrown in the _DragDrop , on the line below?
Hearts = Hearts(Index) What type is the left "Hearts"? Is it a PictureBox?
I are troll
|
|
|
|
|
Starts with Image1(index). I don't think I can make Image1 = Image1(index); an array. Maybe I can just use the Set command?
Let me explain more;
On the left, in design view, I have 52 images of cards in suits. I shuffle them when the start button is pressed. Now, I want to move any of the bottom cards on the left to positions on the right. On the right, there is, let's say, 13 cards of Hearts suit. There is an image on them, not a picture box. Just an image of blank cards. I want that so the player will see where to drop a card. If the card doesn't match the card on the right, then it cannot be dropped there, and basically flies back to it's position on the left, where the player can only put that card in, let's say, a holding area and drop it there for use later. It is solitaire, but played a different way.
Hope this helps....
Thanks in advance.
|
|
|
|
|
Silly me; I figured it out. This works....
Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Index = 12
If TypeOf Source Is Image Then
Hearts(Index).Picture = Source.Picture
End If
End Sub
Private Sub Image1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Index = 12
If Button = vbLeftButton Then
Image1(Index).Drag vbBeginDrag
End If
End Sub
Private Sub Image1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Index = 12
If Button = vbLeftButton Then
Image1(Index).Drag vbEndDrag
End If
End Sub
|
|
|
|
|
Nice
I are troll
|
|
|
|
|
i have searched the internet for a windows explorer like app code, and mostly it is to use a treeview and listview on your form. the code included is so complicated, i don't know where to start...
if possible, i would like something like so:
1.load the the directory folders and the folder files, (2 separate controls)
something simple like, onload, load control 1 & 2
2. when i click the folder directory, the file directory to change as supposed. again, something simple.
3. open file on double click in whatever default app. it is set to open in..
THE CODE SHOULD BE ABOUT AS LONG AS THIS POST..
thanx in advance, since i've been having trouble getting this together for a while, and i just want a windows explorer project, (since i use it quite often), to make it easier to navigate my file locations.
i have came across using the webbrowser for file searching, which works great, but does it slow down the pc to have 4 or 5 of them in a tabcontrol. personally i don't think it should, but i'm not the expert here.
.:trujade:.
|
|
|
|
|
if it all is simple, and as short as your post, then why didn't you just write it, instead of your post?
Anyway, people aren't going to create it for you, so I suggest you search here at CodeProject, or use Google.
|
|
|
|
|
Doesn't VB come with an Explorer (Project/Item)-Template anymore? It used to!
Sorry Luc.
Mouse slip.
I have notified the OP.
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.”
|
|
|
|
|
I have accidentally replied to Lucs post instead of yours. Please see my reply to him.
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.”
|
|
|
|
|
You probably didn't find anything simple, because it ain't that simple as you would dream it to be. I think the Windows Explorer is a piece of art from an engineering point of view. It's not as 'cool' as DOpus 4, but you can extend it in many ways and it performs reasonably well, considering the tasks that it needs to do.
May I suggest that you try to solve your three subproblems, instead of searching for (huge and complex) examples? Even if each step takes a week, that would mean that you could write it yourself within a three weeks - and what's more, you'd gain a deeper understanding of the mechanisms, and be able to explain the inner workings of your application
Worse, you might start to enjoy it along the way and decide to add more and more features.
trujade wrote: i have came across using the webbrowser for file searching, which works great, but does it slow down the pc to have 4 or 5 of them in a tabcontrol. personally i don't think it should, but i'm not the expert here.
"Should"? I think that it is due to a technical limitation, not a mere design-decision. You're free to write a better performing browser off course
I are troll
|
|
|
|
|
I only wish if life was as easy as your post. No clue where to start..
trujade wrote: i have searched the internet for a windows explorer like app code, and mostly it is to use a treeview and listview on your form. the code included is so complicated, i don't know where to start...
obviously you start learning at easy and simple "hello World", not complicated Explorer like code.
trujade wrote: THE CODE SHOULD BE ABOUT AS LONG AS THIS POST..
You seem to have no clue about writing a code. Sorry DUDE. A simple "Hello World" will take as much as your post. Try "hello world" in Windows SDK
trujade wrote: since i've been having trouble getting this together for a while, and i just want a windows explorer project, (since i use it quite often), to make it easier to navigate my file locations.
That is good problem to have, roll your sleve and get to work. It won't be few lines of code though.
trujade wrote: i have came across using the webbrowser for file searching, which works great, but does it slow down the pc to have 4 or 5 of them in a tabcontrol. personally i don't think it should, but i'm not the expert here.
You using WebBrowser control to do file searching. If you can do, I am sure you can write Explorer App.
Looking forward for your article.
|
|
|
|
|
The runtime has encountered a fatal error. The address of the error was at 0x79f89a89, on thread 0xc60. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
I m getting following error when the bellow code is run. The Error is coming in Second Line.
Option 1
MSChart1.EditCopy()
Dim clipdata As IDataObject = Clipboard.GetDataObject()
Dim bmp As Bitmap = clipdata.GetData(DataFormats.Bitmap, True)
PictureBox1.Image = bmp
Option 2
MSChart1.EditCopy()
RichTextBox1 = Clipboard.GetData(DataFormats.EnhancedMetafile)
Option 3
MSChart1.EditCopy()
PictureBox1.Image = Clipboard.GetData(DataFormats.EnhancedMetafile)
Thanks in advance.
|
|
|
|
|
Have you tried something like the following?
If My.Computer.Clipboard.ContainsImage() Then
Dim grabpicture As System.Drawing.Image
grabpicture = My.Computer.Clipboard.GetImage()
picturebox1.Image = grabpicture
End If
The above is taken directly from the MSHelp page on a search for clipboard image
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.”
|
|
|
|
|
It is Showing same error In the first line itself.
If My.Computer.Clipboard.ContainsImage() Then
|
|
|
|
|
That is very strange.
Apart from the fact that Clipboard seems to be the common element, I am at a loss.
If it were me I would be doing a reinstall of Visual Studio. That's all I can suggest.
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.”
|
|
|
|
|
Are you using extra threads? did you modify your app from STA to MTA?
There are issues with the Clipboard and threading, best is to use it straight from the GUI thread, as in a keyboard, mouse or button event handler.
|
|
|
|
|
I m not handle any other Threads In that time.
and i m not modify STA to MTA.
I m using Command Click Event.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MSChart1.EditCopy()
If My.Computer.Clipboard.ContainsImage() Then
Dim grabpicture As System.Drawing.Image
grabpicture = My.Computer.Clipboard.GetImage()
PictureBox1.Image = grabpicture
End If
End Sub
The Above code placed in button event and it is showing error in this line
If My.Computer.Clipboard.ContainsImage() Then
|
|
|
|
|
My OS is Vista Ultimate.
Dev Environment, VB.Net 2008
I have
<EnableVisualStyles>true<EnableVisualStyles>
Set in Application.myapp
and have Declared
Imports System.Drawing.Drawing2D
When I set Form_SSDMain.StatusStrip_ProgressBar.Style = ProgressBarStyle.Marquee
The ProgressBarStyle only displays, ProgressBarStyle.Blocks.
Any ideas please?
Regards, Graham
|
|
|
|
|
Ditto on XP, I think it's in the common controls. There are some custom progressbars on CP that do a marquee correctly (and more!), but that introduces extra code, compared to using the standard progressbar.
I are troll
|
|
|
|
|
Are the blocks moving?
If so that is the designed behaviour for Marquee . It is a 'something is happening' rather than a 'this is how far it's got' indicator.
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 Henry... That gave me the best laugh I have had today.
And I needed that!
Of course the Blocks are moving. That's how I know tht the "Style" is "Blocks".
Give me a break please! That is NOT the designed behaviour for "Marquee", as you put it.
Regards, Graham
|
|
|
|
|
From the MSDN
"Marquee Indicates progress by continuously scrolling a block across a ProgressBar in a marquee fashion. "
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.”
|
|
|
|
|
Please read more carefully.
"a block" is not the same as "blocks".
Regards, Graham
|
|
|
|
|
Ok, so it gives a block of blocks. They give you more than you ask for, and you complain.
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.”
|
|
|
|
|
Hi All,
modified 28-Nov-12 8:32am.
|
|
|
|
|
Purely intuitively, I would say that the problem can be found here:
vijay2482 wrote: name.Substring(0, l)
This will start the substring always at 0 (so it would include the new Nom du module). You only vary the length. What happens when you try something like: name.Substring(pF(1), l) ? In other words vary the starting point as well.
My advice is free, and you may get what you paid for.
|
|
|
|