Results 1 to 11 of 11

Thread: [02/03] Heading

  1. #1

    Thread Starter
    Hyperactive Member ahmad_iam's Avatar
    Join Date
    Jun 2005
    Location
    Pakistan
    Posts
    265

    Lightbulb [02/03] Heading

    I am developing an application like calculatr. I am using ListBox control in my application, I want a an item that is only like a heading. The user can't select it, Just show the user that this is the major catorgory.

    How we can do that ?
    Thanks
    Imran Ahmad Mughal
    "Visual Studio .NET 2005/.NET Framework 2.0"

    The eyes are the greatest telescopes, one will ever need to study the universe. Let the heart be the tripod, the mind be the shaft, then let the eyes become the lens of that great telescope of which God gave to us all.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Candon City, Ilocos Sur, Phils.
    Posts
    11,044

    Re: [02/03] Heading

    How about the Label control?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Hyperactive Member ahmad_iam's Avatar
    Join Date
    Jun 2005
    Location
    Pakistan
    Posts
    265

    Re: [02/03] Heading

    No, I want heading the ListBox control. I am not talking about the Label Control.

    Imran Ahmad Mughal
    "Visual Studio .NET 2005/.NET Framework 2.0"

    The eyes are the greatest telescopes, one will ever need to study the universe. Let the heart be the tripod, the mind be the shaft, then let the eyes become the lens of that great telescope of which God gave to us all.

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Candon City, Ilocos Sur, Phils.
    Posts
    11,044

    Re: [02/03] Heading

    I am not sure if you could put a header in Listbox in .Net but the Listview control have such capability, you may want to look into it...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Hyperactive Member ahmad_iam's Avatar
    Join Date
    Jun 2005
    Location
    Pakistan
    Posts
    265

    Re: [02/03] Heading

    Can we bold an itom in the ListBox control and does not allow the user to select it.How we can do that.

    Imran Ahmad Mughal
    "Visual Studio .NET 2005/.NET Framework 2.0"

    The eyes are the greatest telescopes, one will ever need to study the universe. Let the heart be the tripod, the mind be the shaft, then let the eyes become the lens of that great telescope of which God gave to us all.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: [02/03] Heading

    Just use a ListView control with one column. That way the column header is exactly what you want. You can treat the ListView in pretty much exactly the same way as you could a ListBox, although you will need some slight changes. Remember, there are a multitude of controls and you should use the right one for the job, rather than trying to force one to do a job it was not really designed for. The ListBox doesn't need a header because it only has one column. You would normally use a label to indicate what the contents are, but if you really want a header then the ListView provides one.

  7. #7

    Thread Starter
    Hyperactive Member ahmad_iam's Avatar
    Join Date
    Jun 2005
    Location
    Pakistan
    Posts
    265

    Lightbulb Re: [02/03] Heading

    Quote Originally Posted by jmcilhinney
    Just use a ListView control with one column. That way the column header is exactly what you want. You can treat the ListView in pretty much exactly the same way as you could a ListBox, although you will need some slight changes. Remember, there are a multitude of controls and you should use the right one for the job, rather than trying to force one to do a job it was not really designed for. The ListBox doesn't need a header because it only has one column. You would normally use a label to indicate what the contents are, but if you really want a header then the ListView provides one.
    Can we update the contents of a subitem of the ListView Control at run time. If we can then how. Please explain your question with the help of an example so that I can use ListView Control Instead of Using ListBox Control.

    Thanks
    "Visual Studio .NET 2005/.NET Framework 2.0"

    The eyes are the greatest telescopes, one will ever need to study the universe. Let the heart be the tripod, the mind be the shaft, then let the eyes become the lens of that great telescope of which God gave to us all.

  8. #8
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: [02/03] Heading

    If you're only using a single column then you don't have to worry about subitems. When you add an itemn to a ListView you get the string displayed from its Text property:
    VB Code:
    1. myListView.Items.Add("Item 1")
    2.  
    3. MessageBox.Show(myListView.Items(0).Text)

  9. #9

    Thread Starter
    Hyperactive Member ahmad_iam's Avatar
    Join Date
    Jun 2005
    Location
    Pakistan
    Posts
    265

    Lightbulb Re: [02/03] Heading

    Quote Originally Posted by jmcilhinney
    If you're only using a single column then you don't have to worry about subitems. When you add an itemn to a ListView you get the string displayed from its Text property:
    VB Code:
    1. myListView.Items.Add("Item 1")
    2.  
    3. MessageBox.Show(myListView.Items(0).Text)
    Suppose I have three column in my ListView Control. I have populated first two column at design time and leave the third column empty. I want that at run time I can assign value to this third column. How we can do that at run time not at design time for the third column.

    Thanks
    Imran Ahmad Mughal
    "Visual Studio .NET 2005/.NET Framework 2.0"

    The eyes are the greatest telescopes, one will ever need to study the universe. Let the heart be the tripod, the mind be the shaft, then let the eyes become the lens of that great telescope of which God gave to us all.

  10. #10
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: [02/03] Heading

    This is getting beyong the realms of the original topic. It really is best to start a new thread for questions that don't really relate to the original.

    You would index the Items property to get the row you wanted, then index the Subitems property of that item to get the column you wanted, then set the Text property.

  11. #11

    Thread Starter
    Hyperactive Member ahmad_iam's Avatar
    Join Date
    Jun 2005
    Location
    Pakistan
    Posts
    265

    Lightbulb Re: [02/03] Heading

    Quote Originally Posted by jmcilhinney
    This is getting beyong the realms of the original topic. It really is best to start a new thread for questions that don't really relate to the original.

    You would index the Items property to get the row you wanted, then index the Subitems property of that item to get the column you wanted, then set the Text property.
    Dear give me one example by which i can update the contect of the subitem, so that the concept of updating an subitem content is clear to me at run time not at design time.

    Thanks
    Imran Ahmad Mughal
    "Visual Studio .NET 2005/.NET Framework 2.0"

    The eyes are the greatest telescopes, one will ever need to study the universe. Let the heart be the tripod, the mind be the shaft, then let the eyes become the lens of that great telescope of which God gave to us all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width