Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3627654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:54:56+00:00 2026-05-18T23:54:56+00:00

I am creating a timeline control that uses listbox to place my items on

  • 0

I am creating a timeline control that uses listbox to place my items on a canvas.
There are two parts to it. The base timeline to represent an 8 hour work day and the individual timeline elements which represent the type of work with start and end times.

The timeline element can be resized using a thumb control docked to the left and right of each element. The resizing works fine if I place the timline element on a canvas directly, but as I need to maintain a list of elements I thought that a listbox would handle it for me. So I made the ItemsPanel a canvas and sure enough everything rendered nicely. The only problem was that I could no longer resize the timeline elements. Quickly I relized, that setting the canvas.Left on my element when dragging would do nothing because the element was no longer on the canvas but inside a listboxitem (which is on the canvas).

Is it possible to have a Listbox stop wrapping each item in its own listboxitem and wrap them in say a custom ContentControl instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:54:56+00:00Added an answer on May 18, 2026 at 11:54 pm

    Try this:

    class MyListBox : ListBox
    {
        protected override System.Windows.DependencyObject GetContainerForItemOverride()
        {
            return new ContentControl();
        }
    }
    

    Reference: How to change the default item container for ItemsControl?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a webapp that relies on following a status timeline from twitter
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups.
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
How would you go about creating a timeline animation for an iPhone or iPad
Actually, I am facing a problem in Android. I am creating an application that
Creating a calculator-like dialog, I noticed that quickly clicking on a button in IE
Creating an installer for possible remote systems so that if they do not have
Creating a popup window from main page with window.open, the child/popup page uses the
Is there way to control the movieclip rotation direction - clockwise or counterclockwise? I
I'm creating a graphical timeline out of an excel document and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.