|
|
please forgive me mr. Dave Kreskowiak, because i can't explain my thread to you, because my english is not quitely well
|
|
|
|
|
Soooo you're going to object to me asking questions so you can clarify what you're talking about??
I, also, object. Have a nice life...
|
|
|
|
|
I'm a newbie, but stuck in a loop on this one...
I'm trying to take 13 cards (Hearts 0 -12) which are already set up in design view and check to see if their tag number (also 0 - 12) is equal to the tag number of another 13 cards (Image 1 0 - 12) of another suit. How do I do this w/out the compiler seeing that both hearts and Image1 are already equal to each other.....I'll explain more...
such as:
For Index = 0 To 12
For NewIndex = 0 - 12
'I initialized this to go through the suits in a loop, but what I'm trying to do is see if the tags are equal, as in:
If Image1(Index).Tag = Hearts(NewIndex).Tag
Then.....yadahyadah
Else, yadahyadah
'But if I do this, then it will always equal, because the integers index and newindex were set to 0.....does this question make any sense?
I'm trying to loop through the cards and check to see if their tags are equal so I can do things with the cards...
Thanks in advance.
|
|
|
|
|
nested for loops work like this:
for x = 0 to 9
for y = 0 to 9
do something here
next y
next x
The code at "do something here" will be executed 100 times, like so:
x = 0, y = 0
x = 0, y = 1
...
x = 0, y = 9
x = 1, y = 0
...
See?
If you set your loops up this way, you will definitely compare every item in X with every item in Y, but it's not particularly efficient. You probably want to stop processing once you find a matching tag?
|
|
|
|
|
Thanks for the advice.
I tried something like the following, but when I tried placing the Next, Next lines just below the 'Hearts(Index).Tag = Source.Tag, the compiler gave me an error 340, array element 13 does not exist. It doesn't when I place the Next's at the end. However, what happens at run time is the You're right always happens, and then the card I choose from the left (can be any card), would always appear on the right hand side in hearts(0) slot. I'm confused but think that since Index and NewIndex are set to 0, they will always match and always do vbenddrag, not vbcancel. Any ideas would be much appreciated. Thank you.
'For Index = 0 To 12
'For NewIndex = 0 To 12
'Hearts(Index).Picture = Source.Picture
'Hearts(Index).Tag = Source.Tag
'If Hearts(Index).Tag = Image1(NewIndex).Tag Then
'Image1(NewIndex).Drag vbEndDrag
'MsgBox ("You're right!")
'Exit Sub
'Else
'Image1(NewIndex).Drag vbCancel
'Exit Sub
'End If
'Next
'Next
'End Sub
|
|
|
|
|
You are never getting further than once through, as your code exits the sub regardless of whether heart(index).tab = image1(newindex).tag or not - you have exit sub in both the if and the else!!
ymilan wrote: 'If Hearts(Index).Tag = Image1(NewIndex).Tag Then
'Image1(NewIndex).Drag vbEndDrag
'MsgBox ("You're right!")
'Exit Sub <<<<<<<<<<<<<<<<<< HERE
'Else
'Image1(NewIndex).Drag vbCancel
'Exit Sub <<<<<<<<<<<<<<<<<<< HERE ALSO
'End If
|
|
|
|
|
Hello,
I tried to take them out and then the Msgbox messages would run in an incessant loop at runtime.
I took the message boxes out and tried this; but no card from the image1 side shows up over the card in the hearts side. It is just blank.
Code? Sorry, I'm such a newbie...
If X <= 12 And Y <= 12 Then
Hearts(X).Picture = Source.Picture
Image1(Y).Picture = Hearts(X).Picture
X = X + 1
Y = Y + 1
End If
'should initialize those deck positions right in the array?
For X = 0 To 12 <<<<should I use these For's?
For Y = 0 To 12
Image1(X).Tag = Hearts(Y).Tag <or should I just start with this? But then X and Y will always = each other and it won't go to next lines....it will stop at here.
If Hearts(Y).Tag = Image1(X).Tag Then
Image1(X).Drag vbEndDrag <<<<<is this where I'm messing up?
'MsgBox ("You're right!")
Else
Image1(X).Drag vbCancel
'MsgBox ("You're wrong.")
End If
Next
Next
End Sub
|
|
|
|
|
Where are you actually setting the tags?
Try getting rid of the "you're wrong" message box and the drag cancel etc, and just get it to say "you're right" when you find the right tag.
This will help you work out that your checking routine is working correctly.
|
|
|
|
|
This what I'm trying to do, but what happens is "it is always right" and with "any" card I put into any hearts slot on the right, will put that card right up at hearts(0) and say, you're right. How do I initialize the cards pictures to equal each other, then use next and next for the "for's in the beginning, then question whether the tags = each other. The tag numbers are set in design view.
Here's my code:
Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Dim NewIndex As Integer
For Index = 0 To 12
For NewIndex = 0 To 12
Hearts(Index).Picture = Source.Picture
Source.Picture = Image1(NewIndex).Picture
If Hearts(Index).Tag = Image1(NewIndex).Tag Then
Image1(NewIndex).Drag vbEndDrag
MsgBox ("You're right!")
Exit Sub
Else
Image1(NewIndex).Drag vbCancel
MsgBox ("This card does not belong here")
Exit Sub
End If
Next
Next
End Sub
|
|
|
|
|
Hello every One,
I have a Vb.net 2005 express application.
I will like to define the issue in two folds
- I have to create a controls with many rows and 2 columns having thumbnails. I am not able to decide which control should i use (datagridview or a list view). I had done some experiment with grid and able to do it, but i want to have some text along with the image in same cell only. Is it possible, if so how do i do it. I had declared the col type as imagecol.
- I want to do a drag and drop of image(thumbnail) from one cell to another along with the text. I was able to do drag and drop in 2 individual controls (2 picture box and two text boxes) but having some issues. Can some one plz guide me with the same.
Regards
Nishkarsh
|
|
|
|
|
I would probably do this with a ListView, possibly owner drawn. Just Google for "custom draw listview" for examples.
For an example of creating custom image and text cursors for drag and drop, see this article[^].
|
|
|
|
|
Hi,
i have create simple application using mysql db.
In locallly perfactly working.
but remote connection occur problem.
connection string :
server=XX.XXX.XXX.XXX;Uid=*****;Pwd=****;database=DB;
tanks in advance.
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Hi,
connection strings are language-independent; here is the connection bible.[^]
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Which is generally the first returned site on a Google search.
hmmm
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi,
Iam connecting with my SQL Server 2005 [SQl SERVER Authentication] on LAN Network by Remotely.
------------------------------------------
Data Source=1.1.1.2; initial Catalog=Ep_Mngment; User Id=FORUSERS; Password=XXX
------------------------------------------
My clarification is , when I put the program [vb.net] in network drive, all my users will access the same program.
So the above connection can be usefull for multiaccess [also multi user login at single a/c] at same time?
will it be a problem?
Thanks
|
|
|
|
|
Paramu1973 wrote: Data Source=1.1.1.2; initial Catalog=Ep_Mngment; User Id=FORUSERS; Password=XXX
Your connection string has nothing to do with this, unless you set the database up in such a way that the user FORUSERS is limited to a certain amount of simultaneous connections.
Making the app run from a network drive will be tricky, but assuming that you have successfully tested this, every time a user executes your program, it will create a new instance in the user's own PC's memory, and therefore its own connection to the database.
But beware of the application writing logs (text files), and stuff like that, to the program's own directory.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Use the rule: "what are the absolute minimum amount of rights that I can give a user and they can still complete their job".
So you tell us....
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
hi :
I want to write a program that gets numbers in voice then write them into the text file .
I think I must compair two audio files to make it .
please help me about this problem .
my language is not English.
tanks .
|
|
|
|
|
It's called "Voice Recognition", and just comparing two audio files isn't going to do it.
Google for "Voice recognition" or "speech recognition" for software that can do this.
|
|
|
|
|
Speech recognition. If you're using version 3.0 or 3.5 of the .net framework, then look into the SpeechRecognitionEngine[^] class, and in particular the SpeechDetection event, the RecognizeAsync method and the LoadGrammar method (so you can load the numeric grammar)
|
|
|
|
|
Ah, I forgot about that little corner of the namespace. I've been stuck in .NET 2.0 for so long, I forgot there's a whole other world out there!
|
|
|
|
|
Yeah, I love corners. Finding them and seeing how they interact just makes my day - I really feel I learned something
|
|
|
|
|
Very cool, I was unaware about that as well.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Sr.No Crop Variety Packing Pkts
1 Cot 589 SG 10 8
2 Cot 789 G 1 120
3 Cot 789 G 1 100
4 Cot 789 G 1 15
5 Cot 789 G 1 150
6 Cot 789 G 1 200
7 Cot 789 G 1 2500
8 Cot 789 G 1 200
9 Cot 789 G 1 512
10 Cot 789 G 1 454
11 Cot 789 G 1 454
12 Cot 789 G 1 454
13 Cot 789 G 1 656
14 Cot 789 G 1 455
15 Cot 789 G 1 88
16 Cot 789 G 1 788
i have above grid data in my vb package
when i modify colum 4 and row 4 and save the record but it has been
change colum 4 and row 10 automatically
please help me
thanking you
kishor
|
|
|
|