[2005] Another small quick question
Just a quick thing, Code below is checking collision with tags:
vb Code:
If TypeOf Wall Is PictureBox AndAlso Wall.Tag = "Item Fireball" Then
If Wall.Bounds.IntersectsWith(Pic1.Bounds) Then
Me.Controls.Remove(Wall)
End If
End If
how do i do it so it detects the tag of "Item Fireball" as something like "Item *" as i will have multiple items, each having a tag starting with the word "Item".
Re: [2005] Another small quick question
Please provide descriptive titles for your threads in future.
vb.net Code:
If CStr(Wall.Tag).StartsWith("Item ") Then
VB also has a LIKE operator that you can use to make wildcard comparisons:
vb.net Code:
If CStr(Wall.Tag) Like "Item *" Then
Re: [2005] Another small quick question
ok. and what if the string i want to detect is somewhere in the middle?
Re: [2005] Another small quick question
I edited my previous post to use the Like operator, which can be used to answer you most recent question. Note that the String class also has a Contains method that would do the job.
Re: [2005] Another small quick question
Re: [2005] Another small quick question
Read my signature (the resolve part)
And I can't believe I've never seen that before!!! Thats "Like" crazy
Cheers