Post questions, tips, tricks, and suggestions here

This is just a post where you can post your questions, tips, tricks, suggestions, or what have you. Post these in the comments section. (They are still subject to moderation so don’t waste everyone’s time trying to post links to knock off sunglasses.)

This entry was posted in Uncategorized. Bookmark the permalink.

9 Responses to Post questions, tips, tricks, and suggestions here

  1. szulak says:

    I have write nice article about caching object in C#. You can find it here:
    Caching objects in C#

  2. Fernando says:

    This is one question, and sorry to bother you. I’m trying to develop a Radial Menu for a customer. I cannot see how to check if a point is inside a Pie.
    I appreciate any help.
    Best regards. Fernando

  3. Ello says:

    If you could do a post on winmm.dll in PInvoke.net. Specifically the timeBeginPeriod,timeSetEvent,timeKillEvent, and timeEndPeriod methods. Having a hard time understanding how to use them. Some background:

    The precision of multithreaded timers depends on the operation system, and is typically in the 10-20 ms region. If you need greater precision, you can use native interop and call the Windows multimedia timer. This has precision down to 1 ms and it is defined in winmm.dll.

  4. Ello says:

    Can you explain when I should WPF vs Windows Form?

    • RodStephens says:

      This is mostly a matter of style. WPF provides a rich set of appearances. It allows you to customize how a particular kind of control. It also includes features that let you animate properties. For example, you could make controls move or change size when the user clicks on something. You can also customize the way some controls work. For example, you can change how and where a ListBox displays its values. WPF also has a really easy-to-use media control and some nice layout controls.

      The downside is that WPF is much slower to load and modify in Visual Studio and it’s much harder to make it do the fancy things that make it desirable.

      Both use the same C# code behind the scenes. (That’s why most of the examples on the C# Helper web site are in Windows Forms. They use the same code and Windows Forms is faster and easier.)

      When I just want to get something done that works, I use Windows Forms. If I want to make something look really glitzy with lots of animation (like some of the fancier web sites), I use WPF.

      Microsoft’s original line was, “Old programs would be maintained in Windows Forms and all new development would be in WPF.” I don’t think that has happened. All of the early adopters have moved to WPF, but I think a lot of people are still using Windows Forms. In particular, if you were building a large multi-person project with lots of code behind, would suggest prototyping in Windows Forms and then porting to WPF because Windows Forms is so much easier.

      I hope that helps.

      • Ello says:

        So what your saying is that it would still be wise to learn Windows Forms?

        Thanks your feedback. Greatly appreciate it

        • RodStephens says:

          My thought is that you would ideally learn Windows Forms when you are learning C# so WPF doesn’t slow you down. Then after you have some practice with C#, you can pick up WPF.

          Also note that experience with C# will help you with C++ or Java. Windows forms may help a little, but I don’t think WPF will help you much with other languages.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.