For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
Thank you for the reply. It is not what I mean; In your solution the ICounterprocessor can raise the event, but it's meant to react on the event, like an observer. Maibe I better forget the whole event stuff, and change to Observer like structure?
Hello, when I press the X in the top right hand corner of the application, I get a messagebox. The messagebox ask me a Yes/No question. If I press YES, all is good and the application closes. When I press NO, I can continue to use the application. Now the problem. If I press NO, then I can never press the X in the top right hand corner. It's as if the NO answer disables the ability to ever close the application again. How can I say NO and be able to press the X again when I want to close the application later?
First, I think you should call the base OnClosing method, not the OnClosed as you do. Second, you should call this base handler in both cases, as it will take care with proper action, whether or not event has been cancelled:
Moveable elements: index cards, scrabble tiles, etc.
move: 'grab' and drag with LMB to another part of the window
I'm new to C# and WFC, etc. but have years of experience in PHP, C and other languages.
What I'm looking to know is:
- which element(s) (if element is the right word; checkbox? text entry field? what-have-you?) to use to create a scrabble tile or index card (whatever; the moveable object/thing)
- how movement is handled
Either a general sort-of pseudo code explanation or actual code is fine.
I don't know the terminology used in WFC (if WFC is even the right acronym) so maybe this question doesn't even make sense.
For game "pieces" I'd use either a Panel for rectangular pieces, or a UserControl for custom shaped pieces.
Search CodeProject for articles on drag and drop, and/or creating custom shaped Controls.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
The elements you refer to are from WinForms, and that's not a great engine to build games with
Eddy: What do you use instead of WinForms? And which specific element (or whatever it's called) would you use for (for instance) an index card that can be dragged around and dropped somewhere else within a window?
And which specific element (or whatever it's called) would you use for (for instance) an index card that can be dragged around and dropped somewhere else within a window?
It's hard to say it, I hate to say it, but probably WinForms. It has got built-in support for drag and drop, and there's an article on CodeProject showing how to use any bitmap in that drag-and-drop operation.
If you are into creating games, I'd strongly suggest to look at Unity. If you're looking for beta-testers, I'm here
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
Don't do it like that! Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
When you concatenate strings, you cause problems because SQL receives commands like:
SELECT * FROM MyTable WHERE StreetAddress = 'Baker's Wood'
The quote the user added terminates the string as far as SQL is concerned and you get problems. But it could be worse. If I come along and type this instead: "x';DROP TABLE MyTable;--" Then SQL receives a very different command:
SELECT * FROM MyTable WHERE StreetAddress = 'x';DROPTABLE MyTable;--'
Which SQL sees as three separate commands:
SELECT * FROM MyTable WHERE StreetAddress = 'x';
A perfectly valid SELECT
A perfectly valid "delete the table" command
And everything else is a comment.
So it does: selects any matching rows, deletes the table from the DB, and ignores anything else.
So ALWAYS use parameterized queries! Or be prepared to restore your DB from backup frequently. You do take backups regularly, don't you?
Chances are, when you fix that throughout your application, the problem you have noticed will vanish at the same time.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!