15,918,889 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 C++ questions
View Javascript questions
View Visual Basic questions
View Python 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 dojohansen (Top 6 by date)
dojohansen
16-Jan-13 8:09am
View
That's fine when what you need fits the control concept. If you want to do form things however, a control doesn't really cut it. (For example, you may want to take control over initial placement and size. Layout too can be a natural form responsibility, even if one could solve the same with some kind of panel control and put the panel with dockstyle 'fill' on every form.)
dojohansen
1-Nov-12 11:18am
View
Thanks. Not sure I think this "improve solution" feature will be useful if only formatting can be improved upon, but I do see there may be a problem with it not being immediately obvious who wrote what, and that some may be mislead to thinking you wrote the things I did.
Do feel free to edit your own answer again and remove my additions to it. I now notice another user posted a comment 2 minutes before me which pointed out the same (in fewer words), so the point won't be lost.
dojohansen
1-Nov-12 10:55am
View
> the reason of the edits is to correct or format the text
Maybe. I just saw the fat green link saying "improve solution", and I reckoned this is what CP wants users to do. So I improved it. It did feel a bit odd, which is why I chose not to modify it, but instead add to it.
> don't write things in the name of others
I didn't, and I can't. Did you notice it says "posted" by Simon_Whale and "eited" by dojohansen? If you think it matters much who wrote which bit, there's the versions link (currently reads v2) which will show you the history.
Look, I'll do this in whatever way CP wishes. But I have no idea who you are and I don't know if your word is in any way representative or authoritative in this respect. I do see that the whole voting thing may be more difficult if people can edit each other's posts, but (a) popular opinion counts for just about nothing to me, and (b) it seems to me this is true no matter *what* guidelines users adhere to.
In a case like this, what do you think I should have done? My point was and is simply that @@identity is normally to be avoided (unless somehow you can know both that no triggers are present and that none will ever be), and to explain why one should prefer scope_identity. A comment? Another solution? Something else?
dojohansen
13-Jan-12 9:51am
View
Deleted
Reason for my vote of 3
I don't really agree this is missing from C#. Yes, there are times when it's a little annoying to have to declare a constructor just because of one "auto-property", but let's not pretend this has any major impact on anything. Personally, I feel MS has focused far too much on "convenience" since Framework 2.0 and far too little on providing solutions to problems developers find *difficult*. Let's not fuel the fire.
dojohansen
13-Jan-12 9:47am
View
Deleted
Reason for my vote of 5
Elegant, performant, not too much code (considering its very general nature). I would somewhat agree with those who say it solves a problem that doesn't really need solving - but I think my vote should reflect how well it DOES solve the problem rather than how relevant the problem is!
dojohansen
20-Aug-10 3:05am
View
You can obtain the DPI programmatically, thus requiring your user to do nothing at all to achieve this. In a WinForms/C# context:
float x, y; // DPI in horizontal and vertical direction (tho they should be equal..)
using (var g = this.CreateGraphics())
{
x = g.DpiX;
y = g.DpiY;
}
The using statement is simply to ensure the Graphics is disposed.
Show More