locked
design for windows mobile 6.1, 6.5 RRS feed

  • Question

  • Hi,

    How can I make good design for my application.

    1.How can add image in a background on ListView

    2. Make intresting button

    3.Transparent label...

    Thanks

    Monday, May 30, 2011 12:28 PM

Answers

All replies

  • Hello,

     

    What's your project type, is .NET or MFC?

     

    What's is the intresting button, did you mean a picture button or other shape button?

     

    Best regards,

    Jesse

     


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 1, 2011 7:19 AM
  • Hi, thanks for responce me

    My project type is .NET, C# and I mean a picture button, and how to add picture in bacground on Listview

    And I ask you something else, 

    1. For background in my Form I use picture with this code,

     

     private void Background_Load(object sender, EventArgs e)

            {

                _backgroundImage =  new Bitmap(@"\Program Files\Mobile\AEK.jpg");

                _backgroundImageRect = new Rectangle(0, 0, _backgroundImage.Width, _backgroundImage.Height);

            }

            protected override void OnPaintBackground(PaintEventArgs e)

            {

                base.OnPaintBackground(e);

                Graphics g = e.Graphics;

                g.DrawImage(_backgroundImage, this.ClientRectangle, _backgroundImageRect, GraphicsUnit.Pixel);

            }

            Bitmap _backgroundImage;

            Rectangle _backgroundImageRect; 

     

    In emulator works fine when I compile but when I make installation .CAB file and install on real phone didn't work, give me error.

     

    2. I use Microsoft SQL Server Compact Edition 3.5 database in my application. I fill ListView from table in database, use this code

    private void Form3_Load(object sender, EventArgs e)

            {

                listView1.View = View.Details;

                ListViewItem Item;

                SqlCeConnection con = new SqlCeConnection("Data Source =\\Program Files\\Mobile\\FirstDB.sdf");

                con.Open();

                SqlCeCommand com = new SqlCeCommand();

                com.Connection = con;

                com.CommandText = "select name, number, operator from PhoneBook";

                SqlCeDataReader read;

                read = com.ExecuteReader();

                while (read.Read())

                {

                    Item = new ListViewItem(read.GetValue(0).ToString());

                    Item.SubItems.Add(read.GetValue(1).ToString());

                    Item.SubItems.Add(read.GetValue(2).ToString());

                    listView1.Items.Add(Item);

                }

                con.Close();

    }

    And this works fine in emulator when I compile but when I make installation .CAB file and install on real phone didn't work, give me error.

     

    This is my First application, maybe my installation .CAB file is not good.

     

    Thanks

     

    Wednesday, June 1, 2011 9:11 AM
  • Hi,

     

    It seems that your codes have no problem, I suspect that the path which you include the picture and database is wrong. Please check the path on your real phone.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 2, 2011 7:22 AM
  • Hi,

    Can please provide us error description?

     


    Regards, Malleswar
    Thursday, June 2, 2011 9:23 AM
  • Hi,

    I resolve my problem. The First time I install application on my storage card and a got error. Now I install application on Device and works fine :) The path was the problem

    how to add picture in background on Listview, give me some code for example if you have please

    Thanks

    Thursday, June 2, 2011 4:12 PM
  • Hi Oliver,

     

    As far as I know,  the listview Control.BackgroundImage Property does not be supported by .NET Compact Framework. Therefore, you can use other third-part controls instead of it, or just use Control.BackColor Property instead of it.

     

    I hope my suggestions can help you to solve this problem.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Jesse Jiang Tuesday, June 7, 2011 1:34 AM
    • Marked as answer by Jesse Jiang Friday, June 10, 2011 9:20 AM
    Friday, June 3, 2011 6:12 AM