F9 Group Marketing and Technology Blog

Marketing, Technology, and current news at http://www.f9group.com/

Entries Tagged ‘related’

Follow C# 411 on Twitter

Tired of RSS feeds?  Now you can follow C# 411 on Twitter! Cool Twitter logo from here Related posts:New .NET LogoAdd Drop Shadow to Borderless FormC# Focus TextBox on Form Load Related posts: New .NET Logo Add Drop Shadow to Borderless Form C# Focus TextBox on Form Load

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Type Name “UITypeEditor” Not Found

This is one of those “D’oh!” moments.  You’re creating your own UITypeEditor.  You know the UITypeEditor class is located in the System.Drawing.Design namespace.  So naturally you want to add to your Visual Studio project a reference to the System.Drawing.Design.dll, right?  Wrong!  When you compile your project, the following error may appear: The type or namespace name Related posts: Adding Assemblies to the Visual Studio "Add Reference" Dialog Web Service Stumper: “Ambiguous Type” IEventHandlerService Already Exists in the Service Container

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Add Drop Shadow to Borderless Form

When you create a Form with a border, Windows automatically draws a drop shadow around the form, as shown here: However, if you set the form’s FormBorderStyle property to None, Windows draws neither the form border nor the drop shadow, as shown here: So what if you don’t want a form border, but you do want Related posts: Hide Form from Alt+Tab C# Focus TextBox on Form Load C# WinForms Form Event Order

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

.NET Framework 4 and Extensions Poster

Click the image above to download a .NET Framework 4 and Extensions poster from Microsoft. Want more .NET posters?  Devcurry has published a collection of .NET Framework and Visual Studio posters including keyboard shortcut, namespace and type posters. .NET and Visual Studio Poster Collection Related posts:Visual Studio 2010 and .NET Framework 4.0 Released TodayVisual Studio 2010 and Related posts: Visual Studio 2010 and .NET Framework 4.0 Released Today Visual Studio 2010 and .NET Framework 4 Release Candidate Documentation Available for .NET Framework 4 and Visual Studio 2010

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Get Temporary Directory

To get the path of the current user’s temporary folder, call the GetTempPath method in the System.IO namespace: string tempPath = System.IO.Path.GetTempPath(); On Windows Vista and 7, this method will return the following path: C:UsersUserNameAppDataLocalTemp Related posts:C# Copy Folder RecursivelyCheck Valid File Path in C#Microsoft Sets Windows 7 Pricing and Upgrades Related posts: C# Copy Folder Recursively Check Valid File Path in C# Microsoft Sets Windows 7 Pricing and Upgrades

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

How  and 65279 and Other Byte Order Marks (BOM) Can Mess Up Your XML

When you download XML text from the Web, you may find “garbage characters” in the start of your XML string.  For example, I encountered this result when I downloaded an XML string using WebClient.DownloadString method: <Root><Item>Hello, World</Item></Root> What you are likely seeing is a Byte Order Mark (BOM), which is a Unicode character that indicates the endian-ness Related posts: C# Convert Byte Array to String Read File into Byte Array

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

C# Convert Byte Array to String

It’s easy to convert a byte array to a string.  For an ASCII string, use the Encoding.ASCII.GetString static method: byte[] buffer = new byte[10]; // todo: populate the buffer with string data string s = Encoding.ASCII.GetString( buffer ); Related posts:Convert String to Byte ArrayC# Convert String to Stream, and Stream to StringRead File into Byte Array Related posts: Convert String to Byte Array C# Convert String to Stream, and Stream to String Read File into Byte Array

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Read File into Byte Array

It’s easy to read a file into a byte array.  Just use the File.ReadAllBytes static method.  This opens a binary file in read-only mode, reads the contents of the file into a byte array, and then closes the file. string filePath = @"C:test.doc"; byte[] byteArray = File.ReadAllBytes( filePath ); Related posts:C# Read Text File Line-by-LineConvert String Related posts: C# Read Text File Line-by-Line Convert String to Byte Array C# Read Text File into String

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Programmatically Set Decimal Places

It’s easy to programmatically set the number of decimal places in a decimal, float or double that is converted to a string.  Use the ToString method with the “N” argument summed with the number of decimal places: float value = 3.1415926F; int decimalPlaces = 3; string text = value.ToString( "N" + decimalPlaces ); Note that ‘decimalPlaces’ must be greater Related posts: C# Decimal: Literals, Conversions and Formatting Having Pun with C# In C#, a string is a String

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Graphics.MeasureString Exception: Parameter is Invalid

My C# program threw an exception from the following method: SizeF size = Graphics.MeasureString( text, font ); Unfortunately, the exception’s message was rather obscure: “Parameter is invalid.”  After an investigation, I discovered the error occurred because the font had been previously disposed.  Unfortunately, the Font class does not have the typical IsDisposed property, so there Related posts: Change Font Size Convert Between Synchronous and Asynchronous Change Font Style

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz