16,004,452 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Arthur Dragon (Top 12 by date)
Arthur Dragon
25-Dec-22 12:36pm
View
Deleted
It still does not work:(. All it does now is just highlight a random square red (one I do not click on after clicking) I do not know how to solve this
Arthur Dragon
22-Dec-22 18:45pm
View
Deleted
When I put the cast int value = (int)(((Button)gridEnemy.Children[x]).Tag); it gives out an error point to that line of a null reference exception. I thought the int value is now assigned with a value so the task of assigning it something is done so I don't under how it throws a nullreference.
Arthur Dragon
22-Dec-22 15:09pm
View
It is getting closer but it still does not work. When I do statement inside the for loop (((Button)gridEnemy.Children[x].Tag == 1 the expression gets underlined in red giving out an error that the operator == cannot be applied to operands of type 'object' and 'int'.
Arthur Dragon
22-Dec-22 8:25am
View
I tried putting them all into an Array but it didn't work out so I am using the arrays. This is what I have and it is giving me an error saying x does not exist in the current context. I know that it does not exist but how do I pass the meaning of the x's that were in the assigned to each button in the for loops of the random ship function
enemyShips.RandomShip(gridEnemy);
if (((Button)gridEnemy.Children[x]).Tag == 1)
{
((Button)gridEnemy.Children[enemyShips.x]).Background = Brushes.Red;
}
else
{
((Button)sender).Background = Brushes.Blue;
}
Arthur Dragon
22-Dec-22 6:50am
View
how do I reach out to the tags that I assigned to the x's in the randomShip() function
Arthur Dragon
22-Dec-22 6:49am
View
I am having trouble extracting the tag that I assigned to each random instance into an if statement like if the Tag equals 1 then color the background red upon button click if not 1 then color it blue
Arthur Dragon
17-Dec-22 18:29pm
View
The setting the buttons into the grid rows and columns I have done but I do not know how to randomly generate the computer map
Arthur Dragon
17-Dec-22 11:04am
View
I did all this
Arthur Dragon
17-Dec-22 11:04am
View
Deleted
I am using buttons
Arthur Dragon
17-Dec-22 11:04am
View
Deleted
I am using buttons
Arthur Dragon
17-Dec-22 11:04am
View
I am using buttons
Arthur Dragon
16-Dec-22 5:53am
View
Could I just do it through the two button clicks?
Show More