|
I have most of the code done but I don't know how to make it so the computer tries to win. Here is my code, please HELP!!!!!
Private strPlayer As String = "" 'Used to track whose turn it is
'Declare variable representing game board cells
Private strpbxA1 As String = "Open"
Private strpbxA2 As String = "Open"
Private strpbxA3 As String = "Open"
Private strpbxB1 As String = "Open"
Private strpbxB2 As String = "Open"
Private strpbxB3 As String = "Open"
Private strpbxC1 As String = "Open"
Private strpbxC2 As String = "Open"
Private strpbxC3 As String = "Open"
'This procedure executes procedures required to set up the game
Private Sub frmMain_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Set_Game_Defaults() 'Call procedure that sets default assignments
Clear_Board() 'Call procedure that clears the game board
End Sub
'This procedure sets default assignments
Private Sub Set_Game_Defaults()
txt_One.Text = "Click on Play to begin" 'Display opening message
strPlayer = "Player X" 'Set player X to go first
End Sub
'This procedure clears out the game board
Private Sub Clear_Board()
'Load a blank image into each game board cell
pbx_A1.Image = iml_One.Images(2)
pbx_A2.Image = iml_One.Images(2)
pbx_A3.Image = iml_One.Images(2)
pbx_B1.Image = iml_One.Images(2)
pbx_B2.Image = iml_One.Images(2)
pbx_B3.Image = iml_One.Images(2)
pbx_C1.Image = iml_One.Images(2)
pbx_C2.Image = iml_One.Images(2)
pbx_C3.Image = iml_One.Images(2)
'Mark each game board cell as open and available for selection
strpbxA1 = "Open"
strpbxA2 = "Open"
strpbxA3 = "Open"
strpbxB1 = "Open"
strpbxB2 = "Open"
strpbxB3 = "Open"
strpbxC1 = "Open"
strpbxC2 = "Open"
strpbxC3 = "Open"
End Sub
'This procedure executes when the button labeled Play is clicked
Private Sub btn_One_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn_One.Click
Clear_Board() 'Call the procedure that clears out the game board
Play_Game() 'Call the procedure that begins game play
End Sub
'This procedure begins game play
Private Sub Play_Game()
'Post message that identifies whose turn it is
txt_One.Text = strPlayer & "'s turn."
'Enable all game board cells
pbx_A1.Enabled = True
pbx_A2.Enabled = True
pbx_A3.Enabled = True
pbx_B1.Enabled = True
pbx_B2.Enabled = True
pbx_B3.Enabled = True
pbx_C1.Enabled = True
pbx_C2.Enabled = True
pbx_C3.Enabled = True
btn_One.Enabled = False 'Disable access to the button labeled Play
End Sub
'This procedure executes when the button labeled exit is clicked
Private Sub btn_Three_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn_Two.Click
Application.Exit()
End Sub
'This proceudre executes when a player clicks on the first cell in the first row
Private Sub pbx_A1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_A1.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxA1 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return ''Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_A1.Image = iml_One.Images(0)
strpbxA1 = "Player X"
Else
pbx_A1.Image = iml_One.Images(1)
strpbxA1 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the second cell in the first row
Private Sub pbx_A2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_A2.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxA2 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_A2.Image = iml_One.Images(0)
strpbxA2 = "Player X"
Else
pbx_A2.Image = iml_One.Images(1)
strpbxA2 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the third cell in the first row
Private Sub pbx_A3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_A3.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxA3 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_A3.Image = iml_One.Images(0)
strpbxA3 = "Player X"
Else
pbx_A3.Image = iml_One.Images(1)
strpbxA3 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the first cell in the second row
Private Sub pbx_B1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_B1.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxB1 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_B1.Image = iml_One.Images(0)
strpbxB1 = "Player X"
Else
pbx_B1.Image = iml_One.Images(1)
strpbxB1 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the second cell in the second row
Private Sub pbx_B2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_B2.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxB2 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_B2.Image = iml_One.Images(0)
strpbxB2 = "Player X"
Else
pbx_B2.Image = iml_One.Images(1)
strpbxB2 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the third cell in the second row
Private Sub pbx_B3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_B3.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxB3 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_B3.Image = iml_One.Images(0)
strpbxB3 = "Player X"
Else
pbx_B3.Image = iml_One.Images(1)
strpbxB3 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the first cell in the third row
Private Sub pbx_C1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_C1.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxC1 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_C1.Image = iml_One.Images(0)
strpbxC1 = "Player X"
Else
pbx_C1.Image = iml_One.Images(1)
strpbxC1 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the second cell in the third row
Private Sub pbx_C2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_C2.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxC2 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
vbCrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_C2.Image = iml_One.Images(0)
strpbxC2 = "Player X"
Else
pbx_C2.Image = iml_One.Images(1)
strpbxC2 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This proceudre executes when a player clicks on the third cell in the third row
Private Sub pbx_C3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles pbx_C3.Click
Dim strGameOver As String = "" 'Used to track game status
'Notify the player if the cell has already been taken.
If strpbxC3 <> "Open" Then
txt_One.Text = "The square has already been taken." & _
ControlChars.CrLf & strPlayer & "'s turn."
Return 'Leave the Sub procedure
End If
If strPlayer = "Player X" Then
pbx_C3.Image = iml_One.Images(0)
strpbxC3 = "Player X"
Else
pbx_C3.Image = iml_One.Images(1)
strpbxC3 = "Player O"
End If
'Call the procedure that checks to see if the game has been won
strGameOver = Check_For_Winner()
'Call the procedure that switched player turns or displays a message declaring a winner
Determine_Game_Status(strGameOver)
End Sub
'This procedure determines whether the game has been won and by whom
Function Check_For_Winner() As String
'Check the first row for a winner
If strpbxA1 = strPlayer Then
If strpbxA2 = strPlayer Then
If strpbxA3 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check the second row for a winner
If strpbxB1 = strPlayer Then
If strpbxB2 = strPlayer Then
If strpbxB3 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check the third row for a winner
If strpbxC1 = strPlayer Then
If strpbxC2 = strPlayer Then
If strpbxC3 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check the first colum for a winner
If strpbxA1 = strPlayer Then
If strpbxB1 = strPlayer Then
If strpbxC1 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check the second colum for a winner
If strpbxA2 = strPlayer Then
If strpbxB2 = strPlayer Then
If strpbxC2 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check the third colum for a winner
If strpbxA3 = strPlayer Then
If strpbxB3 = strPlayer Then
If strpbxC3 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check diagonally from top=left to bottom_right for a winner
If strpbxA1 = strPlayer Then
If strpbxB2 = strPlayer Then
If strpbxC3 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check diagonally from top-right to bottom-left for a winner
If strpbxA3 = strPlayer Then
If strpbxB2 = strPlayer Then
If strpbxC1 = strPlayer Then
Return strPlayer
End If
End If
End If
'Check to see if the game has resulted in a tie
If strpbxA1 = "Player X" Or _
strpbxA1 = "Player O" Then
If strpbxA2 = "Player X" Or _
strpbxA2 = "Player O" Then
If strpbxA3 = "Player X" Or _
strpbxA3 = "Player O" Then
If strpbxB1 = "Player X" Or _
strpbxB1 = "Player O" Then
If strpbxB2 = "Player X" Or _
strpbxB2 = "Player O" Then
If strpbxB3 = "Player X" Or _
strpbxB3 = "Player O" Then
If strpbxC1 = "Player X" Or _
strpbxC1 = "Player O" Then
If strpbxC2 = "Player X" Or _
strpbxC2 = "Player O" Then
If strpbxC3 = "Player X" Or _
strpbxC3 = "Player O" Then
Return "Tie"
End If
End If
End If
End If
End If
End If
End If
End If
End If
Return ""
End Function
'This procedure determines whether or not the game is over
Private Sub Determine_Game_Status(ByVal strGameOver As String)
If strGameOver = "" Then 'The game is not over yet
Switch_Players() 'Call procedure that switches player turns
'Post message stating that it is time for players to switch turns
txt_One.Text = strPlayer & "'s turn."
Else
If strGameOver <> "Tie" Then 'There is a winner
btn_One.Enabled = True ''Enable the button labeled Play
'Call procedure that disables game board cells
Disable_Squares()
'Display game over message
txt_One.Text = "Game over. " & strGameOver & " has won."
Else 'The game has resulted in a tie
btn_One.Enabled = True 'Enable the button Play
'Call procedure that disables game board cells
Disable_Squares()
'Display game over message
txt_One.Text = "Game over. There was no winner."
End If
End If
End Sub
'This procedure is responsible for toggling between players turns
Private Sub Switch_Players()
If strPlayer = "Player X" Then
strPlayer = "Player O"
Else
strPlayer = "Player X"
End If
End Sub
'This procedure disables all game board cells
Private Sub Disable_Squares()
pbx_A1.Enabled = False
pbx_A2.Enabled = False
pbx_A3.Enabled = False
pbx_B1.Enabled = False
pbx_B2.Enabled = False
pbx_B3.Enabled = False
pbx_C1.Enabled = False
pbx_C2.Enabled = False
pbx_C3.Enabled = False
End Sub
End Class
|
|
|
|
|
You need to read up on Artificial Intelligence. Basically you can hard code some rules for the game to follow, or write a system where the more you play, the more it learns how to win. No-one is going to explain how to do this in a forum reply.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Heuristic programming is a subject all to itself!
Mobile phones employ it on the predictive text, so do intelligent computers that run interplanetry craft which come across black monoliths.
I suggest the Stanford work is best for you.
------------------------------------
"I am always serious about what I do, not necessarily about how I do it."
Tom Baker
|
|
|
|
|
One option is to check all possible moves that the computer can make. There's a CodeProject article on the game here[^].
Enjoy
I are troll
|
|
|
|
|
Hi all,
i want to use my window base application from different locations.
i have an internet connection having speed upto 256 kbps.
kindly suggest me the best way.
what is the crest and what is the use of it in IT.?
Thanks
rmshah
Developer
|
|
|
|
|
Sounds like you have absolutely no idea what you're doing.
You could use terminal services to connect to a server running your app. That's about it really.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
you can not connect to windows application remotely, unless it is a client/server application. Even with that, only you can interact to the server from the client.
You can connect to a remote machine then use the application. but this has nothing to do with application. There are several ways you can connect to remote machine, Remote Desktop, Terminal Services and connection over the web.
r_mohd wrote: i have an internet connection having speed upto 256 kbps.
This is low speed to connect and work remotely.
|
|
|
|
|
I'm setting up a card game; solitaire, and I want to drag one card on top of a bitmap that looks like a blank card. I want the card image to stay on top IF it matches a certain variable (array of an image). I have the source images as Image1(52) array of cards, and the target images as Hearts(12). I will do Clubs, etc., but am just starting with hearts suit to test. Here is my code so far. I'm having difficulty on trying to figure out how to drag the image and copy it on top of another image if it equals that image's properties (array #).
Private Sub Image1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Index = 12
If TypeOf Source Is Image Then
Image1(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
Any ideas would be appreciated.
|
|
|
|
|
A two-step implementation for drag'n'drop;
- Start the dragdrop operation by calling the DoDragDrop method in the MouseDown event.
- Set AllowDrop to True for the control that you're going to drop things on.
MSDN has dedicated a page to the topic Drag&Drop in VB.NET[^]
I are troll
|
|
|
|
|
Thanks, but I'm doing this in VB6, not .NET. So, it is another name for the method. It won't take the parameters you gave me.
|
|
|
|
|
ymilan wrote: Thanks, but I'm doing this in VB6, not .NET.
No problem, there are also VB6 tutorials[^] available
I are troll
|
|
|
|
|
Thanks, I read this and tried with basically I have an array of cards in design view; trying to drag one of those cards to another array of cards.
Image1(12) to Hearts(12) as an example.
Trying to drag over an icon already in the Hearts(12) position and drop on that icon "after" it equals the value of the card. Kind of weird how I'm doing it, but I wanted to have a visual blank picture of a card in white, and the let's say, hearts King card either underneath hidden or be the same value as the white card. Then when the hearts King is found on the left, it gets dragged and dropped if it matches the king card on the right. I hope I make sense.
Having problems with the array. Compiler won't accept Hearts(12) or Image1(12); says it needs an identifier, so I tried this an it doesn't work. Any ideas would be much appreciated. Thanks in advance.
Private Sub Image1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
Index = 52
Image1 = Image1(Index)
If Button = vbLeftButton Then
Image1.Drag vbBeginDrag = 1
End If
End Sub
Private Sub Image1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
Index = 52
Image1 = Image1(Index)
If Button = vbLeftButton Then
Imag1.Drag vbEndDrag = 0
End If
End Sub
Private Sub Hearts_DragOver(Index As Integer, source As Control, x As Single, y As Single, State As Integer)
Index = 12
Hearts = Hearts(Index)
Hearts(Index).Picture = source.Picture
State = 0
End Sub
Private Sub Hearts_DragDrop(Index As Integer, source As Control, x As Single, y As Single)
Index = 12
Hearts = Hearts(Index)
Hearts(Index).Picture = source.Picture
End Sub
|
|
|
|
|
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
|
|
|
|
|