Türkçe   |   English
Calendar
Categories
Archive
Links
Blogroll
Files

13.11.2009
Is your computer connected to Internet?

Most of the developers ping an internet address or a web site to check whether computer is connected to Internet or not. However there is a much simple and accurate way to achieve this goal which is using an api. I'm sharing the code that you can use in your applications.

        [DllImport("wininet.dll")]
        private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);
        public static bool IsInternetConnectionAvailable()
        {
            int d;
            return InternetGetConnectedState(out d, 0);
        }
Clues,Codes
Comments(1)

11.11.2009
RichTextBox BorderStyle.FixedSingle Problem and Solution
When BorderStyle property of RichTextBox is set to FixedSingle it still acts as Fixed3D. MSDN writes that BorderStyle FixedSingle is not suported for RichTextBox in http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.borderstyle(VS.80).aspx
However there is a workaround to get the desired look of RichTextBox. Putting the RichtextBox into a Panel that has FixedSingle BorderStyle and setting the dock property of RichTextBox to fill and BorderStyle property of RichTextBox to none will solve the problem.
Clues
Comments(0)

03.11.2009
Using of Form.ShowDialog Method

We use Form's ShowDialog method in various parts of applications we develop. However these forms will not be collected by GarbageCollector since they are not manually disposed.

Here are the lines from msdn documentation.

When a form is displayed as a modal dialog box, clicking the Close button (the button with an X at the upper-right corner of the form) causes the form to be hidden and the DialogResult property to be set to DialogResult.Cancel. Unlike modeless forms, the Close method is not called by the .NET Framework when the user clicks the close form button of a dialog box or sets the value of the DialogResult property. Instead the form is hidden and can be shown again without creating a new instance of the dialog box. Because a form displayed as a dialog box is not closed, you must call the Dispose method of the form when the form is no longer needed by your application.

http://msdn.microsoft.com/en-us/library/c7ykbedk.aspx

Codes
Comments(0)




Photos

Seattle 7
Show All
Me in MSDN Forums
Entries
News
Articles