Just as any control a Panel has a Validating and Validated event, but IMO they are of not much use here. I should check the limits in every go button test if you would pass 100 or -100 in a separate method. This passing would depend on the direction so you could use a switch statement. Coming to think of it, you could probably do this in the Move method of your robot!
The location property of your robot contains the REAL Panel coordinates. When you Draw you shift these by adding half width and height so that 0,0 is in the middle of the Panel.
Now to show these in the position Label you have to substract half width and height. For the Y coordinate you also have to change sign!
The attached doc will make it clearer I hope.
Now for your border testing you could use both, it is up to you which you prefer. Succes.
Just as any control a Panel has a Validating and Validated event, but IMO they are of not much use here. I should check the limits in every go button test if you would pass 100 or -100 in a separate method. This passing would depend on the direction so you could use a switch statement. Coming to think of it, you could probably do this in the Move method of your robot!
The location property of your robot contains the REAL Panel coordinates. When you Draw you shift these by adding half width and height so that 0,0 is in the middle of the Panel.
Now to show these in the position Label you have to substract half width and height. For the Y coordinate you also have to change sign!
The attached doc will make it clearer I hope.
Now for your border testing you could use both, it is up to you which you prefer. Succes.
I understand the real and fiction values of the panel. The problem I'm running into is I don't understand if I should use a:
The book shows how to through an argument exception, but not for something like moving an object more for an indexer that validates data and throws an argument.
Or if I just throw an arguementExcept with try if else finally?
Nope my stuff still isn't working, but I'm going to try to just work on getting something to at least validate if it goes over 100 and I'd be happy lol
Last edited by EvilLinux; Sep 27th, 2009 at 7:41 pm.
Nope my stuff still isn't working, but I'm going to try to just work on getting something to at least validate if it goes over 100 and I'd be happy lol
Been playing with for a while and just keep getting a namespace error about it. I would normally think the validation is easier, but everything I've tired to do to get this retarded project to show message once X or Y hits 100 or -100 doesn't work. (this proves me I'm not going to be a programmer in life lol).
My friend took one look at my code and said:
"your putting your if \ else in the wrong place"
I put it at the location = P... And freaking work. I drove myself nuts for nothing on the validation . Now to relax and try to regrow some of my hair .
Thank you so much again for help and direction on this.
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.