469,342 Members | 5,590 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Share your developer knowledge by writing an article on Bytes.

.NET Tips and Tricks

Frinavale
9,735 Expert Mod 8TB
Edit
Many times we spend hours and hours trying to solve a problem. When we finally figure it out, we want to share it to keep others from suffering the same way!

That's why we have this "Tips and Tricks" thread. Post your solutions and tricks that you think will help someone down the road here.

If the tip is complex or long, you might want to consider making an article out of it and posting it in the Insights forum.

Looking forward to all the helpful tips!

--insertAlias

Note: The following was the old thread in the answers forum. I am merging it here for convenience.
/Edit

Frinny's Tip O' The Week
Many of us find our way to Bytes.com seeking help while we're facing a programming problem. Sometimes we just need a pointer to get us going in the right direction.

I've started this thread to provide tips and "how-tos" on common problems that everyone faces. Some of these posts will be provided by me (Frinny) but other's will be selected according to how important and informative the posts are.

I hope you'll find something useful here!

---------------------------------------------------------------------------------------------------------------

The 3rd Week of April 2007:
How To Use Databases:
.................................................. .........................................

The 2nd Week of May 2007:
Sessions:
The 3rd Week of May 2007:
Send E-mails: The 4th Week of May 2007:
Faxes:The 5th Week of May 2007:
Checking TextBoxes for a Number:.................................................. .........................................

The 1st Week of August 2007:
The.Net Framework:
The 3rd Week of August 2007:
Reports:
The 4th Week of August 2007:
Connection Pooling:.................................................. .........................................


The 1st Week of September 2007:
Master Pages:

The 3rd Week of September 2007:
GridViews:
.................................................. .........................................

The 4th Week of May 2009:
Asp.NET Life Cycle: .................................................. .........................................
Apr 21 '07 #1
8 5459
sashi
1,754 Expert 1GB
Hi Frinny,

Great work, keep it up. Good luck & Take care.
Jun 27 '07 #2
Curtis Rutland
3,256 Expert 2GB
I've moved this thread here and resurrected it so we can start posting our helpful tips and tricks. Anything that you figure out that you think may help someone else is welcome here.

Just add a comment with your tip!

Thanks
--insertAlias
Dec 12 '08 #3
balabaster
797 Expert 512MB
Ben's Tip o' the day:

Always save your work before you go home at night and don't expect that your computer won't have rebooted itself by the time you come into work the next morning!
Dec 12 '08 #4
Curtis Rutland
3,256 Expert 2GB
Well, I've recently discovered how to hide the caret (cursor) in a textbox.

Expand|Select|Wrap|Line Numbers
  1. [DllImport("user32")]
  2. private static extern bool HideCaret(IntPtr hWnd);
Then, write an event handler for the "Enter" event for the textbox, and use the handle of the textbox. Like this:
Expand|Select|Wrap|Line Numbers
  1. private void tbOutput_Enter(object sender, EventArgs e)
  2. {
  3.     HideCaret(tbOutput.Handle);
  4. }
Jan 11 '09 #5
An elegant way to parse Enums in C#: http://ko-sw.blogspot.com/2009/03/el...e-c-enums.html
Mar 26 '09 #6
Frinavale
9,735 Expert Mod 8TB
Conversion Chart for C# to VB scope modifiers:
Expand|Select|Wrap|Line Numbers
  1. -------------------------------------------------------
  2.    C#               |    VB
  3. -------------------------------------------------------
  4. public              |  Public
  5. protected           |  Protected
  6. private             |  Private
  7. internal            |  Friend
  8. internal protected  |  Protected Friend
  9. static              |  Shared
  10. const               |  Const
  11. -------------------------------------------------------
Jul 1 '09 #7
Frinavale
9,735 Expert Mod 8TB
A website that helps compare/translate VB.NET -> C#:

VB.NET and C# Comparison
Oct 20 '09 #8
Vertical progress bar
------------------------------------------------------------
Derive your class as shown below
Expand|Select|Wrap|Line Numbers
  1. class VertProgress : ProgressBar
  2. {
  3.       override CreateParams CreateParams
  4.       {
  5.            get
  6.            {
  7.                  CreateParams crParam = base.CreateParams;
  8.                  crParam.Style |= 0x04;
  9.                  return crParam; 
  10.            }
  11.        }
  12. }
Once you build your application, in the toolbar you will see VertProgress. Drag and drop it in the windows form. Strech it vertically.
Oct 30 '09 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Mark Moeykens | last post: by
2 posts views Thread by Panchi51 | last post: by
reply views Thread by travolta003 | last post: by
reply views Thread by travolta004 | last post: by
reply views Thread by smartfix | last post: by
reply views Thread by kamalpp | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.