Tuesday, July 21, 2009
Sunday, July 19, 2009
Saturday, July 18, 2009
www.speedtest.net - to test the speed of your Internet connection
.jpg)
http://www.speedtest.net/index.php
What is Speedtest.net?
Use Speedtest.net to test the speed of your Internet connection. See if you are getting what you pay for or share your results with others!
Speedtest.net is a broadband speed analysis tool that allows anyone to test their Internet connection. Ookla provides this service for free to anyone curious about the performance of their connection to and from hundreds of locations around the world.
What is Speedtest.net testing?
Speedtest.net performs three key measurements used to determine the overall quality and performance of your Internet connection.
* Download Speed
* Upload Speed
* Ping (Latency)
(The time it takes in milliseconds for a small piece of data to be sent from your computer to the Internet and back)
www.speedtest.net - to test the speed of your Internet connection
CamStudio open source - Free Streaming Video Software
.gif)
CamStudio is able to record all screen and audio activity on your computer and create industry-standard AVI video files and using its built-in SWF Producer can turn those AVIs into bandwidth-friendly Streaming Flash videos (SWFs).
It's a perfect, user friendly, free, and practical screen and audio recording app.
http://camstudio.org/
CamStudio open source - Free Streaming Video Software
Friday, July 17, 2009
SQL - Installing SQL Express 2008 - Restart Computer Failed problem
Repeatedly MS SQL Express 2008 installation package asked to restart computer when I wanted to install SQL 2008 Express on a machine.
I needed to check system's pending file rename operations registry key. It should be cleared after rebooting the system. If not, clear it and just click on Re-run or try it again.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
HKEY_LOCAL_MACHINE
SYSTEM
CurrentControlSet
Control
Session Manager
PendingFileRenameOperations

I needed to check system's pending file rename operations registry key. It should be cleared after rebooting the system. If not, clear it and just click on Re-run or try it again.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
HKEY_LOCAL_MACHINE
SYSTEM
CurrentControlSet
Control
Session Manager
PendingFileRenameOperations
SQL - Installing SQL Express 2008 - Restart Computer Failed problem
Wednesday, July 15, 2009
C# -ComboBox- How to move the selected item to top of the list?
In a ComboBox control, the .SelectedIndexChanged event fires when
we select an item then the following code moves the item to top:
...
private void cbo_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cboSender = (ComboBox)sender;
if ( cboSender.SelectedIndex > 0 )
{
string strToFind = cboSender.Items[cboSender.SelectedIndex].ToString();
cboSender.Items.RemoveAt( cboSender.SelectedIndex );
cboSender.Items.Insert(0, strToFind);
cboSender.SelectedIndex = 0;
}
}
...

we select an item then the following code moves the item to top:
...
private void cbo_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cboSender = (ComboBox)sender;
if ( cboSender.SelectedIndex > 0 )
{
string strToFind = cboSender.Items[cboSender.SelectedIndex].ToString();
cboSender.Items.RemoveAt( cboSender.SelectedIndex );
cboSender.Items.Insert(0, strToFind);
cboSender.SelectedIndex = 0;
}
}
...
C# -ComboBox- How to move the selected item to top of the list?
Tuesday, July 14, 2009
C# - How to scroll in RichTextBox control after searching?
To search a value in a TextRichBox control you can use .Find( ... ) method,
and if it can find a match then it returns the index of starting character.
To fit the text and show the found value, .ScrollToCaret() method do the job.
The sample code is as following:
...
int iIndx = this.rtbFileTxt.Find(strFind,
this.rtbFileTxt.SelectionStart,
RichTextBoxFinds.None);
if (iIndx < 0) return false;
this.SuspendLayout();
this.rtbFileTxt.SelectionStart = iIndx;
this.rtbFileTxt.SelectionColor = Color.Yellow;
this.rtbFileTxt.SelectionBackColor = Color.Black;
Point ptCharIndx =
this.rtbFileTxt.GetPositionFromCharIndex(this.rtbFileTxt.SelectionStart);
if (ptCharIndx.Y > this.rtbFileTxt.Height)
this.rtbFileTxt.ScrollToCaret();
this.ResumeLayout(true);
...

and if it can find a match then it returns the index of starting character.
To fit the text and show the found value, .ScrollToCaret() method do the job.
The sample code is as following:
...
int iIndx = this.rtbFileTxt.Find(strFind,
this.rtbFileTxt.SelectionStart,
RichTextBoxFinds.None);
if (iIndx < 0) return false;
this.SuspendLayout();
this.rtbFileTxt.SelectionStart = iIndx;
this.rtbFileTxt.SelectionColor = Color.Yellow;
this.rtbFileTxt.SelectionBackColor = Color.Black;
Point ptCharIndx =
this.rtbFileTxt.GetPositionFromCharIndex(this.rtbFileTxt.SelectionStart);
if (ptCharIndx.Y > this.rtbFileTxt.Height)
this.rtbFileTxt.ScrollToCaret();
this.ResumeLayout(true);
...
C# - How to scroll in RichTextBox control after searching?
C# - How to get the cursor position in a RichTextBox control
- Solution 1:
TextBoxBase.SelectionStart Property
Gets or sets the starting point of text selected in the text box.
* Inheritance Hierarchy
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.TextBoxBase
System.Windows.Forms.RichTextBox
.SelectionStart Property of a RichTextBox control gives you
the cursor position nonetheless you have a highlighted selected
text or not and it doesn't matter that SelectionLength property
is zero or greater than zero.
...
int iCrsrPos = this.rtbCntrl.SelectionStart
...
- Solution 2:
If you want to get character index when mouse moves, you can
get convert Cursor.Position to x and y values of a Point type
which are related to your control (RichTextBox) by calling
.PointToClient( ... ) method, and then call GetCharIndexFromPosition
method to find out the character position.
private void rtbCntrl_MouseMove(object sender, MouseEventArgs e)
{
Point rtbPos = this.rtbCntrl.PointToClient(Cursor.Position);
int iCharIndx = this.rtbCntrl.GetCharIndexFromPosition(rtbPos);
// ... do what ever want you do with the character position
}

TextBoxBase.SelectionStart Property
Gets or sets the starting point of text selected in the text box.
* Inheritance Hierarchy
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.TextBoxBase
System.Windows.Forms.RichTextBox
.SelectionStart Property of a RichTextBox control gives you
the cursor position nonetheless you have a highlighted selected
text or not and it doesn't matter that SelectionLength property
is zero or greater than zero.
...
int iCrsrPos = this.rtbCntrl.SelectionStart
...
- Solution 2:
If you want to get character index when mouse moves, you can
get convert Cursor.Position to x and y values of a Point type
which are related to your control (RichTextBox) by calling
.PointToClient( ... ) method, and then call GetCharIndexFromPosition
method to find out the character position.
private void rtbCntrl_MouseMove(object sender, MouseEventArgs e)
{
Point rtbPos = this.rtbCntrl.PointToClient(Cursor.Position);
int iCharIndx = this.rtbCntrl.GetCharIndexFromPosition(rtbPos);
// ... do what ever want you do with the character position
}
C# - How to get the cursor position in a RichTextBox control
Tuesday, June 30, 2009
Tuesday, June 23, 2009
Came back after 4 weeks holiday
Subscribe to:
Posts (Atom)