Hello,
Does anyone know how to do this? I want to draw verticle lines that
will sit on top of all other windows. Preferably I would do this in
c#.
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
namespace PopupIndicator
{
public static class Program
{
[STAThread]
public static int Main()
{
new Application().Run(new PopupWindow());
return 0;
}
public class PopupWindow : Window
{
public PopupWindow()
{
var stack = new StackPanel {Orientation = Orientation.Horizontal};
Content = stack;
WindowStyle = WindowStyle.None;
AllowsTransparency = true;
Background = Brushes.Transparent;
SizeToContent = SizeToContent.WidthAndHeight;
for(int a = 0; a < 10; a++)
{
var rectangle = new Rectangle {Width = 5, Height = 25, Fill = Brushes.Lime,
Stroke = Brushes.Green};
if(a > 0)
rectangle.Margin = new Thickness(5, 0, 0, 0);
stack.Children.Add(rectangle);
}
}
}
}
}
(H) Serge