Known SDF 2.0 Design Time Issues#

Here is a list of known issues for design time controls.  If you find more please let us know.  These will all be fixed in the next Beta release

 

Issue 1: When a smartlist is dropped on a form the size is 0,0

Workaround: Resize the control to a appropriate size.

 

Issue 2: When deleting a combobox2 from a form a coredll error is thrown

Workaround: Click OK and the combobox will be deleted from the form

 

Issue 3: When deleting an either an inkx or voicerecorder control it looks like the Paint of the base class gets run.  It will render on the form but you can't select, move, delete the control and there is no variable declared for it.

Workaround: After you delete the control, save the form and close the form in designer and re-open it.  The control rendering will be gone.

 

Issue 4: StatusBar/StatusBarPanel still needs to be ported

Workaround: Create the control manually through code.  This will be resolved in the next release.

 

Issue 5: ColorDialog has no design time support

Workaround: Create the control manually through code.  We are working on this issue and hoping to have a resolution by release.

 

 


Wednesday, January 25, 2006 1:02:02 PM (Eastern Standard Time, UTC-05:00) #    Comments [0]  | 

 

OpenNETCF Smart Device Framework 2.0 Beta 1#

Smart Device Framework 2.0 Beta 1 from OpenNETCF has been released.  We have worked really hard to getting this ready and the redistributables for Beta 1 are now available.  The SDF2.0 documentation is also available online.

A lot of work was done throughout the whole SDF but some of the major changes was supporting the the new design time framework for controls for Visual Studio 2005.  Throughout the process we also decided to change some of the class names that ended with 'Ex' to '2'.  For example, OpenNETCF.Windows.Forms.ProgressBarEx is now OpenNETCF.Windows.Forms.ProgressBar2.

There are still some remaing minor issues with some controls and design time support for Visual Studio 2005.  See this post for some of those issues.

Also, check out the new Licensing Class available in the SDF 2.0.  It works the same as the full framework class so if you are looking to license your .NETCF application to your users this will help.

In a future post I will be writing some tips for creating and migrating controls for Visual Studio 2005.


Wednesday, January 25, 2006 1:00:21 PM (Eastern Standard Time, UTC-05:00) #    Comments [0]  | 

 

VP of Microsof Developer Division and Mobility#

S. 'Soma' Somasegar the Corparate Vice President of the Developer Division for Microsoft shares his thoughts on Mobility, .NETCF, Orcas and some things the .NETCF team is working on.  Sounds like there are some great things coming :)


Tuesday, January 17, 2006 12:32:13 PM (Eastern Standard Time, UTC-05:00) #    Comments [0]  | 

 

Selecting Control Text#

Last year I wrote a post on selecting text in a textbox control in two parts.  You can find Part 1 here and Part 2 here.  Another question came up in the news groups on selecting the text of a NumericUpDown control.  Again sounds straight forward since the full .NET framework supports UpDownBase.Select.  To get this functionality requires a little bit of work but is possible. 

Basically to send a message to a control you have to PInvoke SendMessage in coredll.dll (user32.dll for the desktop).  Here is the signature for that:

[DllImport("coredll.dll", SetLastError = true)]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);

To tell the control to select the text, the int msg parameter should be EM_SETSEL which is defined as follows:

private const int SETSEL = 0x00B1;

Now putting all together.  Using Visual Studio 2005 we can create a class called NumericUpDownWithSelect and override the OnGotFocus method.  Here is the implementation

protected override void OnGotFocus(EventArgs e)
{
     base.OnGotFocus(e);

     if (!this.suppressOnGotFocus)
     {
          ThreadStart t = delegate()
          {
               this.Invoke(new SelectAllInvoke(SelectAll));
          };
     new Thread(t).Start();
}

You will notice we are using an anonymous method to invoke the SelectAll Method on the main thread.  Here is the delegate signature and the implementation of SelectAll() and Select():

private delegate void SelectAllInvoke();
public void SelectAll()
{
     this.SelectInternal(0, this.Value.ToString().Length);
}

public void Select(int start, int length)
{
     this.SelectInternal(start, length);
}

SelectInternal() is the code that does the actual work. 

private void SelectInternal(int start, int length)
{
     this.suppressOnGotFocus = true;
     if (!this.Focused)
          this.Focus();
     IntPtr ret = SendMessage(this.Handle, SETSEL, start, length);
     this.suppressOnGotFocus = false;
}

So putting it all together in a nice class that inherits from System.Windows.Forms.NumericUpDown you can extend the functionality of the base class.  Here is the full implementation:

public class NumericUpDownWithSelect : NumericUpDown
{
     public NumericUpDownWithSelect()
     {
     }

     [DllImport("coredll.dll", SetLastError = true)]
     private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);

     private const int GETSEL = 0x00B0;
     private const int SETSEL = 0x00B1;

     private delegate void SelectAllInvoke();

     private bool suppressOnGotFocus = false;

     protected override void OnGotFocus(EventArgs e)
     {
          base.OnGotFocus(e);
          if (!this.suppressOnGotFocus)
          {
               ThreadStart t = delegate()
               {
                    this.Invoke(new SelectAllInvoke(SelectAll));
               };
               new Thread(t).Start();
          }
     }

     public void SelectAll()
     {
          this.SelectInternal(0, this.Value.ToString().Length);
     }

     public void Select(int start, int length)
     {
          this.SelectInternal(start, length);
     }

     private void SelectInternal(int start, int length)
     {
          this.suppressOnGotFocus = true;
          if (!this.Focused)
               this.Focus();
          IntPtr ret = SendMessage(this.Handle, SETSEL, start, length);
          this.suppressOnGotFocus = false;
     }
}

Download the binaries here: NumericUpDownWithSelect_Binaries.zip (3.67 KB) 


Tuesday, January 17, 2006 12:15:32 PM (Eastern Standard Time, UTC-05:00) #    Comments [8]  | 

 

Toronto Code Camp#

We are having our first ever Code Camp in Toronto on Jan 14 (this Saturday).  I will actually be doing my first ever presentation here on the OpenNETCF Smart Device Framework 2.0 (yes 2.0 is coming).  I will be presenting with some beta bits so hopefully the demo gods will be with me that day.  If you are in the Toronto area and are going let me know.  There are a total of 20 sessions going on and we have already booked over 300 people!  I'm the last session of the day so hopefully people will stick around :)


Thursday, January 12, 2006 5:19:11 PM (Eastern Standard Time, UTC-05:00) #    Comments [0]  | 

 

IDisposable Cursor#

You usually want to display the cursor in your Compact Framework application when you are running a long process so the user of your application knows that there is something going on. Using the System.Windows.Forms.Cursor is pretty straight forward.  To show the cursor you do a:

//Show Cursor
Cursor.Current = Cursors.WaitCursor;
Cursor.Show();

And to hide the cursor you can write the following:

//Hide the cursor
Cursor.Current = Cursors.Default;
Cursor.Hide();

This is not rocket science but what it can lead to (and I have seen it) is showing/hiding the cursor all over the place which makes for messy code.

By creating a new class called Cursor2 and implementing IDisposable we can use the using statement in our code and makes for much cleaner and nicer code.  Here is the Cursor2 class implementation:

public class Cursor2 : IDisposable

{

    private static int _refCount = 0;

    public Cursor2()

    {

        if (_refCount == 0)

        {

            Cursor.Current = Cursors.WaitCursor;

            Cursor.Show();

        }

        _refCount++;

    }

    public void Dispose()

    {

        _refCount--;

        if (_refCount < 0)

            _refCount = 0;

        if (_refCount == 0)

        {

            Cursor.Current = Cursors.Default;

            Cursor.Hide();

        }

    }

}

Now in your long running process you can use the following to show the cursor:

LongLoadingForm llf;
using (new OpenNETCF.Windows.Forms.Cursor2())
{
   llf =
new LongLoadingForm();
   //Extra initialization done
}
llf.ShowDialog();

Once your form has completed loading the cursor will automatically hide because of the using statement.  Result is nice clean code to maintain and if the Compact Framework cursor implementation changes or there are additions there is only one place you have to make the change.


Tuesday, January 10, 2006 3:19:20 PM (Eastern Standard Time, UTC-05:00) #    Comments [0]  | 

 

Buy a Pixel#

Kirk Ballou who created the RSS flash reader has now started a website called Pixel By The Slice. Basically you buy a pixel for a $1 (minimum of 100) and can use it as an advertising mechanism.  He's already got two logos on the main page.  Pretty interesting idea, I'll try to keep everyone posted on the progress.


Monday, January 09, 2006 4:17:17 PM (Eastern Standard Time, UTC-05:00) #    Comments [1]  | 

 

First Post of The Year#

From the outside looking in it seems that I have been pretty dormant since my last 'real' post was about the SDF Webbrowser control and the behaviour on PocketPC and Windows CE.  Two things have been keeping me busy

  1. My current project i'm working on is starting to finish up.  I'll post more details on this once the official press release is out and the product is officially announced.  We did frequent releases to the client just to get the product in front of them and start getting feedback quickly.  This was very effective but forced us (really me) to automate everything early in the development stage.  This also kept us busy adding features, fixing bugs teaking etc.  I was also managing five developers for this project which is good and bad. 
    Two bad parts:
    • First, many thought I was just a 'manager' with no technical skills. A few tried to pull fast ones on my by saying 'it's not possible', it will take 'x' amount of days (when really it should only take 'y') or 'there is not enought time'.  All bullsh!t excusses that I didn't buy...they quickly came to find out that I was not 'technically challenged'. 
    • Second, finding five developers in such a short amount of time was a pain!  This was my first time where I actually had the responsibility to find people. At first I had techinical questions that I would ask to try and weed people out.  This worked somewhat but I had to let go of one guy who knew all the answers to the questions but had no clue on coding!!! Plus to top it off he had his MCSD!!!  Since the techincal questions didn't really work, I started doing a 'technical development test'.  Basically I gave the candidate a box with VS, SQL and internet access.  Then handed him/her a paper with the 'software requirements' and two hours to complete.  I couldn't beleive the amount of people who couldn't even get the application compiling because of all the cut and pasting they did from the internet!!!  Either way this was very effective in finding who was good and who wasn't suitable for the position.  Plus it took up a lot less of my time!
  2. Have been working many late nights to get OpenNETCF SDF 2.0 ready.  Stay tuned for more information in the coming days for this....

That's basically the two main things keeping me busy (and this doesn't include all other personal items I won't bore everyone with).  I have a whole list of technical items to blog about (both .NET CF and Fx) so stay tuned....


Monday, January 09, 2006 4:12:30 PM (Eastern Standard Time, UTC-05:00) #    Comments [0]  | 

 

All content © 2008, Mark Arteaga
Related Sites
Archives
Sitemap
Disclaimer

Powered by: newtelligence dasBlog 1.9.7174.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts