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 5933631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:00:01+00:00 2026-05-22T15:00:01+00:00

Is there a marker bar component for a C# application what i could use

  • 0

Is there a marker bar component for a C# application what i could use in my application? As marker bar i mean something like ReSharper adds to Visual Studio:enter image description here

Another example for something similar (the bar on the left):
enter image description here

EDIT: I found non-free component for java http://www.sideofsoftware.com/marker_bar/doc/sos/marker/JMarkerBar.html what does exactly what i want to do. It doesnt suite for me but maybe it helps someone.

  • 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-22T15:00:01+00:00Added an answer on May 22, 2026 at 3:00 pm

    In WPF the bar is a bit like a ListBox with just a different way of displaying a 1 pixel high line for each line of text. The state of the line would influence the color of the line and selecting a line would raise the SelectionChanged event to which the textbox could respond.

    Let me know if you want me to show a prototype.

    EDIT

    Here goes. You can click/select a line in the bar and the textbox will scroll to that line.

    Still to add:

    1. what to do when the number of lines is to large for the bar?

    2. A different way to show the line that is current in the bar?

    3. Keep the selected line in the bar in sync with the caret in the text box.

    4. …

    These can be solved but depend largely on what you want. This should get you started.

    XAML:

    <Window x:Class="WpfApplication2.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:WpfApplication2"
            Title="MainWindow"
            Height="350"
            Width="525">
        <Window.Resources>
            <local:StatusToBrushConverter x:Key="statusToBrushConverter" />
        </Window.Resources>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <ListBox ItemsSource="{Binding}"
                     SelectionChanged="ListBox_SelectionChanged">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment"
                                Value="Stretch" />
                        <Setter Property="Opacity"
                                Value="0.5" />
                        <Setter Property="MaxHeight"
                                Value="1" />
                        <Setter Property="MinHeight"
                                Value="1" />
                        <Style.Triggers>
                            <Trigger Property="IsSelected"
                                     Value="True">
                                <Trigger.Setters>
                                    <Setter Property="Opacity"
                                            Value="1.0" />
                                </Trigger.Setters>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
    
                </ListBox.ItemContainerStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Rectangle StrokeThickness="0"
                                   Stroke="Green"
                                   Fill="{Binding Status, Converter={StaticResource statusToBrushConverter}}"
                                   Height="1"
                                   HorizontalAlignment="Stretch" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <TextBox AcceptsReturn="True"
                     Grid.Column="1"
                     x:Name="codeBox" />
        </Grid>
    </Window>
    

    C#:

    using System;
    using System.Collections.ObjectModel;
    using System.ComponentModel;
    using System.Linq;
    using System.Windows;
    using System.Windows.Controls;
    
    namespace WpfApplication2
    {
        public partial class MainWindow : Window
        {
            private CodeLines lines;
    
            public MainWindow()
            {
                InitializeComponent();
    
                lines = new CodeLines();
    
                Random random = new Random();
                for (int i = 0; i < 200; i++)
                {
                    lines.Add(new CodeLine { Status = (VersionStatus)random.Next(0, 5), Line = "Line " + i });
                }
    
                this.DataContext = lines;
    
                codeBox.Text = String.Join("\n",  from line in lines
                                                select line.Line);
            }
    
            private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
            {
                var selectedLine = ((ListBox)sender).SelectedIndex;
                codeBox.ScrollToLine(selectedLine);
            }
        }
    
        public enum VersionStatus
        {
            Original,
            Added,
            Modified,
            Deleted
        }
    
        public class CodeLine : INotifyPropertyChanged
        {
    
            private VersionStatus status;
    
            public VersionStatus Status
            {
                get { return status; }
                set
                {
                    if (status != value)
                    {
                        status = value;
                        OnPropertyChanged("Status");
                    }
                }
            }
    
            private string line;
    
            public string Line
            {
                get { return line; }
                set
                {
                    if (line != value)
                    {
                        line = value;
                        OnPropertyChanged("Line");
                    }
                }
            }
    
            public event PropertyChangedEventHandler PropertyChanged;
    
            protected void OnPropertyChanged(string propertyName)
            {
                var p = PropertyChanged;
                if (p != null)
                {
                    p(this, new PropertyChangedEventArgs(propertyName));
                }
            }
        }
    
        public class CodeLines : ObservableCollection<CodeLine>
        {
        }
    
    
        class StatusToBrushConverter : IValueConverter
        {
            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                var status = (VersionStatus)value;
                switch (status)
                {
                    case VersionStatus.Original:
                        return Brushes.Green;
                    case VersionStatus.Added:
                        return Brushes.Blue;
                    case VersionStatus.Modified:
                        return Brushes.Yellow;
                    case VersionStatus.Deleted:
                        return Brushes.Red;
                    default:
                        return DependencyProperty.UnsetValue;
                }
            }
    
            public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                throw new NotImplementedException();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a tool in the market that takes Visual Studio nmake files, and
is there any way to add a visual marker for cropping using the cropping
Is there a way to make a marker on the MapView bounce? I mean
I have a marker interface something like this: [AttributeUsage(AttributeTargets.Method, AllowMultiple=false, Inherited=true)] public class MyAttribute
Note: marked as community wiki. Is there a good analysis of why visual programming
Is there any ruby or Java Web based Virtual Class Room Components like 1.Whiteboard
In Android 2.3 and below, you could make an application full screen, and then
There is a horizontal ListBox (of Images) in my application. At application startup, I
In my application I am using the new Action Bar Compatibility sample from Google
There are tons of pay and free bluetooth toggles on the market that work

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.