473,587 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drawing shapes above all other windows (like a volume indicator)

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#.

Thanks
Dec 4 '07 #1
3 2063
Omatase,

You might want to create a transparent window and then draw on that,
making sure the window is on top of all other windows. You could set the
window to be a tool window, which should keep it on top.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Omatase" <Om*****@gmail. comwrote in message
news:08******** *************** ***********@l1g 2000hsa.googleg roups.com...
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#.

Thanks

Dec 4 '07 #2
You might want to create a transparent window and then draw on that,
making sure the window is on top of all other windows. You could set the
window to be a tool window, which should keep it on top.
I have tried doing that but the lines I draw are also Opacity 0% when
I do that. Do you know a way to keep the shape opacity at 100% with
the form opacity at 0%?
Dec 4 '07 #3
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().R un(new PopupWindow());
return 0;
}

public class PopupWindow : Window
{
public PopupWindow()
{
var stack = new StackPanel {Orientation = Orientation.Hor izontal};
Content = stack;

WindowStyle = WindowStyle.Non e;
AllowsTranspare ncy = true;
Background = Brushes.Transpa rent;
SizeToContent = SizeToContent.W idthAndHeight;

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.Margi n = new Thickness(5, 0, 0, 0);
stack.Children. Add(rectangle);
}
}
}
}
}

(H) Serge
Dec 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
12993
by: Remon Huijts | last post by:
Hi there, For a very specific service, I have created a PHP script that uses the GD library functions to create a PNG image from a few lines of XML data describing a simple diagram/drawing. It's cool and works, writing the XML data in a text editor is straightforward for me because I designed the format. I have no idea however how I can...
13
3305
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a referenced, custom dll. I call a PrintImage routine in the dll and pass it only the the Picturebox.hdc from the main form. The dll's print routine...
1
2510
by: Andreas Schubert | last post by:
Hello newsgroup, I am pretty new to .NET and need some advise on how to approach to the following: I have to create an application with a drawing surface, where some predefined shapes (picture boxes with icons in it) can be dropped and moved around. This should work like some MS Visio on a very basic level. The shapes should be dragged...
2
2613
by: Dursun | last post by:
Collegues, is it possible to do the foloowing: Let end user draw specific shapes (a circle that has a number within it and a connector that points to a specific area on the background image) using Windows Forms and controls. To be more specific, I want to design a VB.Net Windows form where end user will mark damages on an airplane picture...
1
1713
by: Sam | last post by:
Hi guys I'm writing a small drawing program which has "snap to grid" mode and I want to display something (some kind of shapes for example a small square or circle which indicate the current snap point of my mouse) but I have no success so far. I tried controlpain.drawreversibleframe method to draw a tiny square to indicate my current snap...
3
3912
by: Mad Scientist Jr | last post by:
I am looking to make a homegrown vector drawing tool, similar to making vector drawings in Word or Powerpoint. It should be easy to use and intuitive, like Word or the old MacDraw. I want to make it easy for beginners, as opposed to something harder or more involved like Illustrator or Flash... It would support shapes like * rectangle *...
9
3163
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I want to be able to draw lines in a picturebox based upon certain data points I have received. I dragged a picturebox from the toolbar onto my form,...
10
2177
by: Tina | last post by:
I need to find drawing software for my websites. I'm guessing that Adobe Photoshop is an overkill. What's best for creating bitmaps usable for websites? Thanks, T
3
8448
by: kamleshgk | last post by:
Hi, I have a requirement to draw a rectangle and a line on a the container control and sometimes as i move the mouse the drawing must occur on top of user controls and other controls, which are placed in the container control... I'm using System.Drawing namespace (C#) to perform the drawing. But as i move the mouse and draw the...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.