|
Thanks, i will have a good read and give that a bash
|
|
|
|
|
I will add an alternate example where the 'SendResult Func/Delegate is triggered within the log-in form, and a more standard EventHandler declaration is used in the main form: this may be clearer.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Im very new to this and i usually search the web for the answer but i got stucked and i need help from community.
I have two datagridview on different tables and i wanna show them on a same crystal report.
Iv done it with one of em using XML Schema but what to do with other datagridview.
TY in advance
|
|
|
|
|
2 reports right after one another is the same as 1 report. Or combine the 2 grids if you want "2 up" (and can't figure out how to put 2 grid controls on one row).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hello,
Can anybody give me any guidance on how to create an if else statement on a background colour of a label.
For example, if the background colour of a label is white then do this else do this.
|
|
|
|
|
if (backcolor == "white")
{
}
else
{
}
Although you may wish to clarify your question with some more details of exactly what your code is trying to do.
|
|
|
|
|
Hello
thanks for such a quick reply and help, I have a mouse leave event on label 28. where once you leave the label it changes white.
then when you finish the maze at finish_point i want it to check if the label28 background colour is white. if it is then do the below close between the {} else bring up a message box stating you haven't found the treasure/ loot.
private void Finish_Point(object sender, EventArgs e)
{
this.Close();
th = new Thread(opennewform);
th.SetApartmentState(ApartmentState.STA);
th.Start();
}
|
|
|
|
|
Don't rely on colours - instead create a class level bool that tells you "the user left the label" instead. It's a lot more readable (and thus maintainable) and less prone to error later when you change things around.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
if (myLabel.BackColor == Color.White)
{
... do something
}
else
{
... do something else
} Be aware though both that a color test is specific: a tiny change in shade will fail the test, and that you can't assume any colour scheme on the part of the user: if you check for White, and the user prefers a Dark scheme it will fail, while SystemColors.Control may match.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Brilliant, Thank you this has worked.
Great help
|
|
|
|
|
Hello
I have a maze game with 3 forms/ levels.
When hit certian labels it will take you to another level by closing the current form and then opening the specified form.
I am now wanting to add some sort of treasure or scoring system that you need to collect and then the game keep a track of your score.
Is there anybody who can help me with this? I can supply you with code if you wish to look at the application.
Thanks
|
|
|
|
|
We can't really help you with any specifics: we have no idea how your code works - and I for one don't want to wade through a pile of code trying to work out what part does what and why!
The way I'd do it is different: I wouldn't close the form and reopen a new one, I'd reuse the current form by clearing the play area and loading a new one from a file, using the same method I used when I first loaded a form - it's a lot more flexible that way than by designing a "static form" as a maze each time!
Having said that, I'd have a GameObject abstract base class, and derive Wall, Door, Player, Monster, Treasure, and ExitLevel classes from that. Your game board then becomes an array of GameObject instances, and the base class ensures that the derived classes have Move, Open, Attack, and so forth methods which they can handle. The Wall and Door classes for example refuse to move in any direction, but the Player can move provided nothing blocks his way. Doors and Chests can Open, Monsters can Attack and be Attacked and so forth.
How does yours work? Please, don't say "a button for each space on the board" because I'll get quite depressed ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Some people use "story boards" to help with their design. You need to decide what to do with this "treasure", etc.
How to Storyboard Your Game - Gamescrye Blog
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hi,
I have a DataGridView, a save button, and a load button. I have seen in some tutorial that it is possible to export DataGridView content into Excel or *.txt file. But I want to save my contents into an unknown file which can only be read by my own App. How is it possible? Is there any tutorial for this purpose (I use C#)?
|
|
|
|
|
|
Basically, it's not possible: you can't "restrict" which apps can open a file (if you could, MS would use it for Word, Excel, and PowerPoint files for sure). Any app can open any file.
But ... they may not understand the content they look at - and that may be enough for you. If you encrypt your data before you write it to the file, and decrypt it when you read it, the it will certainly be harder for other apps to use.
The problem is that no matter how secure you need your data to be, remember that any app can read any file - and that does include both your data file and your application EXE file. So since your app would need to know the decryption key in order to read your encrypted data, it's a relatively simple matter to get the key from your EXE and then use it on the data files.
It's up to you to decide how "unreadable" you need your data to be and how much work you are prepared to put into it. Be aware that with any security intensive development, unless you research really well, fully understand the code you are writing / using, you can easily make your data less secure than plain text, rather than more!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Use Isolated Storage.
Isolated Storage | Microsoft Docs
You can also "roam" isolated storage via One Drive so any device running that app gets synced, if you want.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hello
I have made a maze and want to be able to go to a new level.
I have made the maze and i need it to go to a new form when the mouse enters the label.
Can anybody help me or does anybody know what code can be used to close form one and open form two from entering a label with the mouse?
|
|
|
|
|
Add a MouseEvent, and when it fires then close one form and open the next.
|
|
|
|
|
Ok so when i enter the event i would need to close form1 and open form2
I am a beginer and am just learning. Is this easy code?
|
|
|
|
|
Don't close Form1 - that's likely to be your "startup form" and when that closes your application will automatically be terminated. Your players may get annoyed if they get to the end of a level and the app shuts down ...
Instead of that, consider "reusing" the original form: just clear out the existing maze and draw in your new one - it's the same process you did in the first place to "fill in" your Form1 when the app started, or should be, just with different maze data. You are loading your maze data from a file, I assume?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I made a user control to represent cardboard boxes, probably a bad idea.
The idea is to be able to add a box, like if you have 3 boxes. I was thinking like in Angular, you can make a control array, so it was just natural for me to make a user control.
I placed one on my dialog, and I'm just drawing a blank on how to handle this on the dialog.
Haven't tried anything yet, but did look around and all the examples were for check boxes.
I suppose if I can't make it work, I can re-purpose it to fill a list box, or to fill the box array in my model.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
What do you do with the "boxes"?
In Windows Forms, WPF and UWP there are "wrapping" controls with a .Children collection, that will space out anything you add to them: user controls; buttons; shapes; etc. No "positioning" required.
You attach click / touch / mouse / wheel handlers to these "children" (that you add) to get them to do what you want. (Or you intercept events at the form level if you can determine the target: fewer hooks)
You iterate over the .Children (or a shadow observable collection) if you want to do some group action.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
To assist you, we need to know more about what the "boxes" represent, how they are used, does the user interacts with them at run-time, etc. Do the "boxes": contain other Controls: if so, what are they ?
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Message Closed
modified 28-Oct-20 7:14am.
|
|
|
|