Forgot your password?
Sign in with
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Python questions
View C++ questions
View Java questions
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Design and Architecture
Internet of Things
C / C++ / MFC
ATL / WTL / STL
Objective-C and Swift
Hardware & Devices
Hosting and Servers
.NET (Core and Framework)
Site Bugs / Suggestions
Spam and Abuse Watch
The Insider Newsletter
The Daily Build Newsletter
Most Valuable Professionals
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Comments by Lockwood (Top 14 by date)
Create the new shape at offset coordinates?
Didn't realise I could do that myself. Will do.
I can fully understand that you're new to this - everyone started somewhere.
However, it seems to me like you are trying to run before you can walk. If you get all of the information spoonfed to you then you will tend not to get as much understanding of the fundamental concepts as if you do some research and then apply that research to your problem.
A case in point would be the sample I gave you earlier (which I now realise has a small bug in it). It creates a timer that runs after 232,000 millisecond (or 3 minutes 52 seconds) and then fires an event. If we modified that code to make something occur after it had been called 10,000 times, that event would fire after almost 27 days!
There are a lot of good books and tutorials out there, but you do need to respect that you are currently inexperienced and will need to look at the basics first and then move on from there.
I would recommend as a starter that you look up these topics:
1: Conditional flow (ie Select Case, If)
2: Iterations/loops (Do While, Do Until, For/Next)
3: Variable scope (Private, Public), also look up Static
These will help you in this task and are essential knowledge for pretty much any subsequent task
Yeah... That's really not how it works.
You need to use Raif's approach. Stop and think about where you are, where you want to be and how you want to get there.
One, that's long intro video.
Two, tie the event in to video events, not a timer.
I'm guessing this is what OP was after.
A 3:52 delay to displaying Form1 would seem a bit strange.
You MUST pay serious thought to SQL Injection attack though, hopefully your different solution takes that into account.
I think I had my mind still working in part on the string concatenation from the original questions, which took me down that road.
That's a fair point - I'd not thought of the possibility of using culture settings as an attack vector.
This is one of the few examples where that is not going to be a problem - Date.Now is not user-provided information.
Edit: That sounded a lot meaner than I meant it to.
You are correct, parameters are important things to use.
You're not going to like this but the best thing to do with this project is to stop, take a deep breath and have a look at the whole thing from a distance.
As others have said, your data structure is not that great. Your object names are not that great either. Take the time now to refactor as much as you can and then look at the project again once you have completed that housekeeping.
I'll do it for nine!
As I said, it is a solution that warrants a link to a discussion on the pros and cons of it.
For very simple UI thread tricks, it is a very useful tool. for more complex stuff, it is not the safest tool to use.
If the OP does just want to spin some text on screen on a timer, DoEvents is safe and full threading is overkill. If OP is wanting to do more than that then other alternatives need to be looked into.
Reason for my vote of 1
Last Updated 1 Jan 1900
All Rights Reserved.