Showing posts with label Custom Controls. Show all posts
Showing posts with label Custom Controls. Show all posts

Friday, January 15, 2010

JWMD Picture Browser Control

I made a simple picture browser control because of some reason that Microsoft.WindowsMobile.Forms.SelectPictureDialog did not include filenames at the bottom of the icon on the lists.

So again.. here’s the control

pbc01
- Here’s the interface after
loading the pictures
pbc02
- after clicking the browse button
just after the path box.
NETCFFolderDialog control
appears
pbc03
- interface while loading.
 

ok. that’s pretty much it..

code snippet is very simple

JWMDPictureBrowserControl.PictureBrowser pb = new JWMDPictureBrowserControl.PictureBrowser();
pb.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
pb.Filter = ".png;.jpg;.bmp";
pb.ShowDialog();
MessageBox.Show("Selected file: " + pb.FileName);
DOWNLOAD HERE
 arrow
Type: DLL Fle
Size: 11kb
January 23, 2010
- UPDATE:
Trapped Errors ..

Initial Release - January 16, 2010

Tuesday, October 6, 2009

JWMD ExceptionBox

I have made my own ExceptionBox (window) for my applications in case something went wrong. I hate the default exception window in Windows Mobile ..

Anyway, here are some screenshots

image image image
Supports InnerException
image Exception Icons
image
 

Code Snippet

try
{
int x = 0;
int y = 1;
int z = y / x;
}
catch (Exception ex)
{
using (ExceptionBox.Window frm = new ExceptionBox.Window("Error Occured", ExceptionBox.ExceptionIcons.Exception, ex.Message, ex))
{
frm.ShowDialog();
}
}
  Download the binaries here
Initial Release
October 7, 2009
Download

Wednesday, August 19, 2009

.NET CF Open File Dialog and Folder Dialog

ah, probably the first annoying Windows Mobile control. As a first time developer for Windows Mobile, I found this control, very very very inconvenient to use. I was actually developing something in Windows Mobile and I haven’t gone far on it and I have to use OpenFileDialog and that control crashes my plans.

would you like to say hello?
image image
iiiiiyuuccck!
Who in Microsoft Windows Mobile team make some stupid control like that? I can’t browse for subfolders!! What a lazy developer! So I made up my mind and decided to make my own. I actually made 2 controls.

NETCFOpenFileDialog and NETCFFolderDialog

Here are the screen shots and Code Snippets.

I made a test form so I can see the result after calling the forms
image

NETCFOpenFileDialog + NETCFFolderDialog Control

image image image
image image image
image image
the file extension automatically adds to File Type dropdown.
Doesn’t look like the control familiar to you?

:)

Code Snippet

NETCFOpenFileDialog.OpenFileDialog ofd = new NETCFOpenFileDialog.OpenFileDialog();
ofd.DefaultPath = @"\Windows\Start Menu\Programs";
ofd.Title = "Open File Test";
ofd.Filter = "JPG|*jpg;PNG|*.png;ALL FILES|*.*";
ofd.OpenDialog();

if (ofd.Filename != string.Empty)
{
txPath.Text = ofd.Filename;
}

NETCFFolderDialog

image  

Code Snippet

NETCFFolderDialog.FolderDialog ofd = new NETCFFolderDialog.FolderDialog();
ofd.DefaultFolder = @"\Windows\Start Menu\Programs";
ofd.OpenDialog();

if (ofd.Folder != string.Empty)
{
txFolder.Text = ofd.Folder;
}

Download the binaries here
NETCFOpenFileDialog.zip