Friday, July 10, 2009

Wrap text in label in .NET Compact Framework

Wrapping text in label is a big issue in .NET Compact Framework. We often need to wrap text in label. But in normal label we can’t do that. We need to create a customize one. The following link will help you too much in this:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=476018&SiteID=1

Tuesday, April 21, 2009

Transparent image problem in .NET Compact Framework.

We often face a problem with transparent image in .NET Compact Framework. For finding a solution of this problem I searched a lot and at last found an article here:
http://johan.andersson.net/blog/2007/10/solution-for-transparent-images-on.html
This article really helped me much to find a solution of image transparency problem in .NET Compact Framework.

Wednesday, February 18, 2009

Microsoft to open Application store for Windows Mobile

Microsoft Corporation is going to open an application store for Windows Mobile. This is one of the most important news in Mobile World Congress 2009 in Barcelona. For more information see the following link: http://tech.yahoo.com/news/nf/64541

Wednesday, January 7, 2009

Essential books on Windows Mobile Development.

Till now I have discussed about different programming aspect in Windows Mobile Development. But today I will name of some essential books that are very much helpful for developers in Windows Mobile Development. At first I want to name of the book
Microsoft Mobile Development Handbook
by Andy Wigley, Daniel Moth and Peter Foot
This book is very good for the developers who are a little bit experienced.
Next the book I want to mention is
.NET Compact Framework Programming with Visual Basic .NET
By Paul Yao, David Durant
Authors Paul Yao and David Durant have also written the book
.NET Compact Framework Programming with C#
These above two books are very helpful not only for the beginners but also for the experienced developers.
Specially for the beginners I recommend to follow any one of the second or third book.

Tuesday, December 23, 2008

Change project build mode from Debug to Release

In every project after completing the whole work we need to change the project build mode from Debug to Release before delivery to the client. To change the project build mode at first go to “Build” menu, then “Configuration Manager” submenu.

Change “Active solution configuration” from Debug to Release. Then close it.

After this press F5. Now the application will run and you will see the .exe file has been generated on the \bin\Release folder.

Monday, December 8, 2008

Set image to Picture Box from webpage.

A few months ago I learnt an interesting thing. I have to set an image to a Picture Box from a webpage. For the first time I was a little bit surprised to hear this. But after completing the code, I realized that it was not too hard that I was thinking of.

First declare and initialize an HttpWebRequest object such as:

Dim req As Net.HttpWebRequest = DirectCast(Net.HttpWebRequest.Create(url), Net.HttpWebRequest)

Here url is the respective url of the webpage that contains the image.

Now declare and initialize an HttpWebResponse object such as:

Dim res As Net.HttpWebResponse = DirectCast(req.GetResponse, Net.HttpWebResponse)

Now declare and initialize an Image object such as:

Dim img As Image = New System.Drawing.Bitmap(res.GetResponseStream)
res.Close() 'Closes the response.

Your image is ready. Set the image to the Picture Box:

PictureBox1.Image = img
PictureBox1.Size = PictureBox1.Image.Size

The last line of code changes the size of the Picture Box to the size of the image that is set to the Picture Box.

Monday, December 1, 2008

Change the ListView column width.

Sometimes we face problems with ListView. The problem is that: suppose you have set the column width of a ListView in design time. But when the ListView is populated with data, then we see if there exists much data, all data are not showed. After some words “….” appears. This means more data exists. But we can size a column of its contents. Just write down the following code after adding an item to the ListView.

[c#]
lvTest.Columns[0].Width = -1;

[vb]
lvTest.Columns(0).Width = -1

Here lvTest is the name of the ListView. If the column width is set to -1, the column is sized to the width of the widest item in it.