473,786 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set Opacity when dragging a form

EinToR
20 New Member
I'm trying to set the opacity = .50 when dragging a windows form. Here's what I've got:

Expand|Select|Wrap|Line Numbers
  1.         public Form1()
  2.         {
  3.             InitializeComponent();
  4.             this.Move += new EventHandler(Dragging);
  5.         }
  6.  
  7.         private void Dragging(object sender, EventArgs e)
  8.         {
  9.             Opacity = .50;
  10.         }
When I run the application, the Move event is fired from the get-go. What 2 events can be overloaded to set the opacity "OnDragStar t" and "OnDragStop "?

Thanks,
Aug 7 '08 #1
2 1500
joedeene
583 Contributor
you could possibly use the resizebegin and resizeend form events, heres an event in visual basic.net

Expand|Select|Wrap|Line Numbers
  1. Private Sub MainForm_ResizeBegin(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeBegin
  2.  
  3. Me.Opacity = 0.6
  4.  
  5. End Sub
  6.  
  7. Private Sub MainForm_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeEnd
  8.  
  9. Me.Opacity = 1
  10.  
  11. End Sub
Aug 8 '08 #2
EinToR
20 New Member
That worked GREAT!!! Thank's for your help.
Aug 8 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1801
by: chris | last post by:
I've used JavaScript DOM scripting to create a table element and alter its opacity. Bizarrely, the contents of the table appear to vanish when the opacity changes. One important note is that I am using transparent PNGs as background images of elements within the table. The following CSS is used to style two elements within the table: ..arrowLeft { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/core/images/arrow.png',
2
2454
by: Adam | last post by:
Hi everyone, I have a simple timer which decreases the Opacity from 1.0 to 0.0 and back again. The problem I have is, when it changes from 1.0 to 0.99, the whole form flickers completely before the smooth fading out. It never does it from 0.0 to 0.1, only from 1.0 to 0.99. Anyone seen this before?
6
3722
by: Robert A. Boudra | last post by:
As you will probably guess, I'm just starting out with VB.net although I'm a long time VB developer. I was playing around with the Opacity property of a form and have found that I can set the property at design time or in code just fine, but as soon as I move the form to a new location on the screen, it becomes completely opaque. If I then try to set the opacity property again, I get an error message. Any idea what's going wrong? Bob
1
4493
by: Brian | last post by:
If your like me, you have probably seen way too many demos of the opacity property of a form. Well I finally have a need for it and I am having an issue. I am trying to create a splash screen that looks like Adobe Acrobat's which appears to draw outside its bounds. To do this, I am setting the Transparency of the SplachScreen form to its background color and then drawing my screen (which appears to have no background). It looks really...
1
3402
by: yosh | last post by:
Trying to make a splashscreen, i can make it work if i in sub new() on the main form set opacity to 0, show the splashscreen and then in the splashscreen set the main forms opacity to 100 right before closing the splashscreen... but thats gives me some nasty performance problems... the form is generally slow, this is probably a known bug so if anyone has a sollution to that id be greatful. but when trying to use me.visible = false on...
5
2910
by: Webmaster | last post by:
The following style sets the opacity or semi-transparency in Mozilla and Explorer browsers for an image: #myImage{ filter: alpha(opacity=50); -moz-opacity:0.50; opacity: 0.50; } <img src="someimage.jpg" name="myImage" id="myImage"> The alpha(opacity=50 does it in IE and the opacity: 0.50 does it Mozilla.
2
2348
by: reidarT | last post by:
I want a windows form to act like the one in Outlook when you get a new message and it is visible for about a couple of seconds and then the opacity decreases and the form dissapears in the end I have tried with Dim p As Integer Dim Vent As Integer For p = 100 To 0 Step -1 Me.Opacity = p For Vent = 1 To 100000
3
4297
by: Boki | last post by:
Hi All, I saw the paint.net program, when mouse hover, the color palette become 100% opacity. I try the code below, the issue is I also have some other controls ( textbox/button ) in my form, it should be a better way to do it in fewer codes, right ? ( set all hover function to the same as form ? )
1
2027
by: akshaycjoshi | last post by:
I am ShowDialoging one form in which the activate event increases the opacity from 0 to 1. I set the opacity to 0 in it's constructor.The problem is that during the showing of the form it becomes black. And after it's opacity becomes one it becoems the normal color (Control). The code is as follows public Form1() { InitializeComponent(); this.Opacity = 0; }
0
9497
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7515
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.