15,741,981 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 Javascript questions
View C++ questions
View Python questions
View Java 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 Alvaro Carballo Garcia (Top 9 by date)
Alvaro Carballo Garcia
13-Jun-13 14:33pm
View
No problem. Good luck.
Alvaro Carballo Garcia
13-Jun-13 14:06pm
View
Actually, when I firstly saw your code I said to me "what on the hell will he be doing with this array of pictureboxes without handlers". The problem, bahman01 is that the taken approach is not right. Sergey's advice makes every second more sense: take it easy and start step by step. Firstly understand exactly the best way to accomplish the most difficult part here (line drawing) and then do some research to keep clarifying all your doubts (like creating objects with handlers at runtime).
Alvaro Carballo Garcia
13-Jun-13 13:58pm
View
OK, thanks.
Alvaro Carballo Garcia
13-Jun-13 13:51pm
View
What you mean with how to control the handlers? All the code inside the pic_MouseMove (I would use MouseEnter, MouseHover and MouseLeave but yours works too... you can create as many handlers as you wish by doing the same that you did for pic_MouseMove) function is triggered when the mouse moves over the given pictureBox. You can use them just as triggers of what you want when you want; don't need to use the arguments (at least, for what you are doing): "PictureBox thisPB = (PictureBox)sender" is a waste of code you can access the pictureBox directly, either via pics or via pic.
I think that you have too many not-so-clear ideas; why not following the advice of Sergey, doing everything step by step and understanding each single bit?
Alvaro Carballo Garcia
13-Jun-13 13:10pm
View
OK, OK. As said, I am a poor ignorant (on this specific matter) and just wanted to help a bit to correct a simple problem, without looking at the big picture. Perhaps I should have let this question for more experienced developers on this who might see beyond the small errors and give a solid and really-helpful feedback. I will intend to not make the same error again. I am new in all this thing of participating in online programmers' networks :)
Alvaro Carballo Garcia
13-Jun-13 13:02pm
View
Your code works fine (I mean... for what you want). I did pass the pointer over the new picture being created and the lines were generated.
Alvaro Carballo Garcia
13-Jun-13 13:01pm
View
Sergey, I have to accept your expert opinion. I don't know too much about the matter and haven't analysed alternatives. A priori, I would rely on draw events rather than on other thing. But as far as apparently he wants it done in this way, I thought I should defend his position.
Alvaro Carballo Garcia
13-Jun-13 13:00pm
View
Deleted
Sergey, I have to accept your expert opinion. I don't know too much about the matter and haven't analysed alternatives. A priori, I would rely on draw events rather than on other thing. But as far as apparently he wants it done in this way, I thought I should defend his position.
Alvaro Carballo Garcia
13-Jun-13 12:46pm
View
Well... I did test his code and it works. After providing the proper coordinates, two lines are drawn without any problem.
Show More