开发者

Windows Mobile:No listview sample for C# WM standard SDK development?

Forgive me if i'm wrong. I am trying to learn and build listview to show the text vertically in listview. I'm wondering that no-where i found listview samples for WM standar开发者_开发百科d SDK using C# language. Can you share if you know any details about listview samples for WM standard SDK using C# language? Please note, i need to show the text one by one Vertically in listview.

I felt starting with c# language for WM development is not suggestible, i think .Net framework or c++ languange with win 32 should be always good for developing any WM applications?

Thanks.

EDITED: "ctacke " answered it correctly. But if anyone can share the link where i can have some samples of doing custom listview vertically, let me know. Thanks to all replies.


You might look into the OpenNETCF's Smart Device Framework Community Edition which has a ListView control. Be warned though that it requires VS2005, AFAIK, there is no VS2008 version - I found out the hard way and VS2008 got a tad bit messed up as a result, but, you can most certainly add a reference to them in your project..have a look at the documentation that comes with it.

Hope this helps, Best regards, Tom.


The .NET Compact Framework has a standard ListView control as described here. The article also has a C# example on how to create a ListView, add items to it and add it to your form.


Christian Helle has a good blog entry on custom-drawn ListView controls. He doesn't cover vertical text, but I can't imagine any tutorial is going to be that specific. You simply need to custom draw the items and rotate the font drawing manually.


private void FillListView()
{
     // Set the view to show details.
    listView1.View = View.Details;
    // Allow the user to edit item text.

    // Display check boxes.
    listView1.CheckBoxes = true;
    // Select the item and subitems when selection is made.
    listView1.FullRowSelect = true;


    // Create three items and three sets of subitems for each item.
    ListViewItem item1 = new ListViewItem("item1");
    // Place a check mark next to the item.
    item1.Checked = true;
    item1.SubItems.Add("1");
    item1.SubItems.Add("2");
    item1.SubItems.Add("3");
    ListViewItem item2 = new ListViewItem("item2");
    item2.SubItems.Add("4");
    item2.SubItems.Add("5");
    item2.SubItems.Add("6");
    ListViewItem item3 = new ListViewItem("item3");
    // Place a check mark next to the item.
    item3.Checked = true;
    item3.SubItems.Add("7");
    item3.SubItems.Add("8");
    item3.SubItems.Add("9");

    // Create columns for the items and subitems.
    // Width of -2 indicates auto-size.
    listView1.Columns.Add("Item Column", -2, HorizontalAlignment.Left);
    listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
    listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Left);
    listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center);

    //Add the items to the ListView.
    listView1.Items.Add(item1);
    listView1.Items.Add(item2);
    listView1.Items.Add(item3);

    // Add the ListView to the control collection.
    this.Controls.Add(listView1);
}

and also http://www.businessanyplace.net/?p=code#listviewgrid

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜