OpenNETCF 1.3 SDF Released

The SmartDevice Framework 1.3 from OpenNETCF.org was released on Thursday at MEDC 2005.  There are some great new additions to the SDF.  Biggest one I think is the Application Blocks for Compact Framework.   Check out Neil Cowburn’s entry on the whole story behind the Blocks and OpenNETCF  Also check out the new integration of the SDF within VS.NET.  There is also a new mailing list available to communicate with the SDF team and users. Just type ‘subscribe’ in the subject and send mail to sdf-dev@netcf.tv to subscribe.  Go download and enjoy and give feedback!!

Instrumentation for .NET Compact Framework Applications – MSDN Article

I got my first MSDN article published today…actually don’t know when it went up but I noticed it today.  It’s an instrumentation library for the .NET Comapct Framework.  Here is the link http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnnetcomp/html/instnetcfapp.asp 


I welcome all comments and suggestions.  If you have any email me at info[at]markarteaga[dot]com or marteaga[at]neotericsdc[dot]com

Selecting TextBox Text Part II

Thanks to Daniel Moth for the tip on using a Timer instead of a thread to select text in the textbox. Basically it negates the need for Sleep() and/or Invoke() and makes for a bit cleaner code. Here is the updated code.  I have left the thread version in the GotFocus but have commented it out.


 


private TextBox currentTB = null;
    private void GenericTextBox_GotFocus(object sender, System.EventArgs e)
    {
        this.currentTB = (TextBox)sender;

        //Use a timer to select all. This will negate the need for Invoke or sleep in the thread. Thanks to Daniel Moth for this 🙂
        Timer t = new Timer();
        t.Interval = 10;
        t.Tick+=new EventHandler(t_Tick);
        t.Enabled = true;

        /*
         * USE THIS SECTION TO USE A THREAD BUT THE TIMER METHOD IS BETTER/CLEANER
        System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(SelectAll));
        t.Start();
        */

    }

    private void SelectAll()
    {
        if(this.currentTB!=null)
        {
            //Usuall the Invoke should finish after the got focus event finishs. If you experience problems add a sleep
            //System.Threading.Thread.Sleep(50);
            currentTB.Invoke(new EventHandler(InvokeSelectAll));
            currentTB = null;
        }
    }

    private void InvokeSelectAll(object sender, System.EventArgs e)
    {
        ((TextBox)sender).SelectAll();
    }

    private void t_Tick(object sender, EventArgs e)
    {
        ((Timer)sender).Enabled =false;
        this.currentTB.SelectAll();
    }

Newsgroup “Etiquette”

Daniel Moth writes about some “rules” for using the NGs.  I completely agree and hope people read and follow.  One thing I would like to add


“Due Diligence”
Do your due dilegence before posting.  By this I mean please do some research before posting or try to code something before posting.  If you can’t get your code working then first go to Google and type in your problem.  Usually by searching the problem in Google or Google Groups and searching specifically in the Compact Framework Group you will most likely find an answer to your question.  If trying to write the code yourself and searching Google/Google Groups doesn’t help then post a question but please learn to help yourself first. 

Selecting TextBox Text

There was a question in the newsgroups about selecting text in a textbox when it receives focus.  I thought it was as simple as TextBox.SelectAll() but apparently it’s not!  If you trap the OnFocus event and use SelectAll() it does work but when the OnFocus handler is done the base Textbox puts the carret where ever the user clicked the stylus thus removing the selectAll(). 


Here is some code to overcome this:


private TextBox currentTB = null;
private void GenericTextBox_GotFocus(object sender, System.EventArgs e)
{
  this.currentTB = (TextBox)sender;
  System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(SelectAll));
  t.Start();
}   
 
private void SelectAll()
{
  if(this.currentTB!=null)
  {
    //Usuall the Invoke should finish after the got focus event finishs. If you experience problems add a sleep
    //System.Threading.Thread.Sleep(50);
    currentTB.Invoke(new EventHandler(InvokeSelectAll));
    currentTB = null;
  }
}

private void InvokeSelectAll(object sender, System.EventArgs e)
{
  ((TextBox)sender).SelectAll();
}

OpenNETCF and SourceGear

Have to give a huge thanks to Eric Sink of  SourceGear for donating licenses for Vault and Dragnet to the OpenNETCF team.  I have never used Vault or Dragnet  but I have been a reader of Eric’s blog and his articles (which I recommend you read).  So far Vault and Dragnet are awesome.  Now that there is proper source control a lot more things can be done for the SDF and have a lot more users/developers get involved. 


Check out the OpenNETCF.org news item for more details and Neil Cowburn’s blog entry.


Again thanks Eric…I think everyone will agree with me that we are in a much happier place!

Help OpenNETCF.org Help you

Check out Neil’s Call To Action With all the volunteer work that goes into the OpenNETCF.org Smart Device Framework (SDF) I think it’s only appropriate that users help by donating what they can to help cover some of the costs to make the SDF available to everyone.  I’m sure it’s saved a lot of late nights for many people and has helped many people save their jobs 😉


Here is the link to donate which is also available on www.opennetcf.org site.


Make payments with PayPal - it's fast, free and secure!
Help us help you!