Set The Transparency Key To The Form Back Colour?
Mar 20, 2011[URL]
i hav a transparent png. i need the form also to be transparent so what i did was set the transparency key to the form back colour see what happens (it is in the pic)
[URL]
i hav a transparent png. i need the form also to be transparent so what i did was set the transparency key to the form back colour see what happens (it is in the pic)
My VB2010 programme changes the background colour of a button (butExtra.BackColor = Color.Red). But how do I restore the colour to the default "Control" colour?
View 2 RepliesI've got a combobox which loads the system colour list, the selected colour is stored in the registry (i've tried storing the index number value aswell as the colour name - how can i get the combobox to display the stored colour as the default colour when the form loads? It always defaults to the first item in the colour list I've tried
[Code]....
I'm writing on a texthandler-project for Vista.(Compiler : Visual Studio 2010-vb)My code must write a string back to file after trimming. I've decided to run the application as a full trust app. The code obtains the permission via fileiopermission,but still the result is:Acces is denied/Unauthorizedaccessexception (It's not Readonly).
I attached a image of menu bar. I set the background color which is the form background color. But when run the application the color is still default.
View 3 RepliesMy DGV has row BackColors set to various colours based on business logic. When a user selects the row the colour changes to the selected row BackColor thus obscuring the pre-set colour. I would like to preserve the original colour when a row is selected and indicate selection with (perhaps) a bold border around the selected row.
EDIT :To make it clear, this is a WinForms app.
I am looking for a regular expression that can convert my font tags (only with size and colour attributes) into span tags with the relevant inline css. This will be done in VB.NET if that helps at all.I also need a regular expression to go the other way as well.To elaborate below is an example of the conversion I am looking for:
<font size="10">some text</font>
To then become:
<span style="font-size:10px;">some text</span>
So converting the tag and putting a "px" at the end of whatever the font size is (I don't need to change/convert the font size, just stick px at the end).The regular expression needs to cope with a font tag that only has a size attribute, only a color attribute, or both:
<font size="10">some text</font>
<font color="#000000">some text</font>
[code]....
I also need another regular expression to do the opposite conversion. So for example:
<span style="font-size:10px;">some text</span>
Will become:
<font size="10">some text</font>
As before converting the tag but this time removing the "px", I don't need to worry about changing the font size.Again this will also need to cope with the size styling, font styling, and a combination of both:
<span style="font-size:10px;">some text</span>
<span style="color:#000000;">some text</span>
[code]....
I am extracting basic HTML & text from CDATA tags in an XML file and then displaying them on a web-page.The text also appears in a rich-text editor so it can be edited/translated, and then saved back into a new XML file. The XML is then going to be read by a flash file, hence the need to use old-fashioned HTML.
The reason I want to convert this code is mainly for display purposes. In order to show the text sizes correctly and for it to work with my rich text editor they need to be converted to XHTML/inline CSS. The rich text editor will also generate XHTML/inline CSS that I need to convert 'back' to standard HTML before it is saved in the XML file.I know the temptation will be to tell me a number of different ways to set up my code to do what I want but there are so many other permutations I haven't even mentioned which have forced me down this route, so literally all I want to do is convert a string containing standard HTML to XHTML/inline CSS, and then the same but the other way round.
Is there any way to change the colour (background colour or text colour) of just a certain item or item(s)?
View 2 RepliesIs it possible to have transparency on a form but not on a button on the form?I know transparency can be controlled for the form in properties (VB 2005), but how can we isolate the button from being affected?
View 2 RepliesTo .NET after getting tired of using VB6 due to the lack of functionality. I'm trying to create a log on method for a system which will involve users selecting a colour from a paint panel and then placing/drawing the colour in 1 or more tiles of a grid, basically a 3x3 grid in which for example they selected the blue colour and drew in the top left tile and the bottom left tile. The logon is selecting the correct colour and placing the colour in the appropriate tile. What i want them to be able to do is place even a single pixel of colour so it has a high accuracy. So far i have a timer which loops from the width of the grid to the height of the grid.
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Dim BMP As New Drawing.Bitmap(1, 1)
Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP)
GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _
[CODE]...
To start with i have just hard coded the colour i want it to detect. At present it produces an error. Parameter must be positive and < Width the error is on System.Drawing.Point(i,j). If i place the mouse over the colour then run the program it will say it has been found, but otherwise it wont find the colour. I believe i am not updating the location of the pixel or something to that effect.
So I have got a program with a timer on, a few labels displaying coordinates, and two buttons. Here is my
[code]...
It displays the color of the pixel at the coordinate typed into the text boxes.I have a video of a tennis ball which is bouncing on the spot, and the background in brown, so when the tennis ball comes into view there is a significant color change and i want it to start and stop a timer each time the colour changes significantly.So my question is, how do i get it to check whether the colour chas changed significantly?
I want to try an simulate a fake lighting system in Visual Basic 2010 by using 2 images.One is Form1's background, and the other is Picturebox2's image. Picturebox2's image is a black background with a transparent circle in the middle.The only problem is, when transparent, it shows the background of the form, and looks right through the background image.How could I get around this so that the transparent part of the image is Form1's background image, and not the backcolor?
View 4 RepliesI am working on an application which has transparent forms. By using transparency, I am smoothing the edges of the forms. I have got a bitmap which I set as background image of the form. I use red as form's transparency key. Although transparency works fine when my computers display is set to 24 bit color, when I change the setting to 32 bits, transparency doesn't work. In this case, users who have 32 bit color dept setting on their systems will not be able to use my application. When I searched the web, I found some solutions such as using bitmap.maketransparent command, or using magenta color for transparency key or using 32 bit bmp files etc. However none of them worked for me. Some forums suggest that this is a bug and there is no way to solve this problem. But if so, why some applications such as Winamp can display transparent forms although my color dept is set to 32 bit! I am sure there is a solution. I am working on VB.NET 2008 and my OS is Windows Xp Service Pack 2. Please help me about this subject.
View 10 Repliesi am looking to change the windows colour and colour intensity. These settings are accessable through Control PanelAppearance and PersonalizationPersonalizationWindow Color and Appearance But is there a way that i can remotely change these two settings through functions in my windows form application? Also is there any way of removing the slight blur on the window bars/taskbar when using an aero theme?
View 1 RepliesI used some code i found that extends the aero glass border across the entire form... looks great... however when i add a control (like a datagridview) it doesnt look right at all because of the transparency of the form...
View 5 RepliesI have just converted my first VB6 application to a VB Express version. I have a fair sized library that I would like to convert but I am having a severe problem with a very simple little game program that I selected for a trial conversion. The problem is this. I do a lot of graphic / art work in my GUI and heavily use labels with transparent backgrounds. When I converted to VB Exp 2005 the labels are no longer transparent but rather carry the background color attribute of the Form. Is this how MS implemented transparency in VB 2005? If so the product is of no use to me whatsoever. I checked the Labels attributes and they are set to transparent. But they are not being displayed as such.
View 3 RepliesHow can i set the transparency Key in MDI parent Form?
View 1 RepliesI can't get the transparency key to work with the mdi child, I really need it to work as well, but I just can get it to work properly.
View 2 RepliesI'm trying to write some toast-style popup notifications (similar to Growl) which should appear next to the system tray and stack as appropriate.I can handle the instantiation/location/etc... but I want to add a capability for non-rectangular toasts. I'd also like to have Alpha transparency so a semi-transparent background PNG on the toast form would blend with the desktop or windows behind it.
So... To get the obvious out of the way: Form.TransparencyKey is not sufficient for my needs as it's an all-or nothing transparency effect I want to get 50/50 foreground/background in some places, 0/100 in others, 100/0 in yet others etc.My initial approach is to override the OnBackgroundPaint() method, comment out the call to MyBase.OnBackgroundPaint and use the graphics object in the eventargs to draw exactly what I want to a form.This seems to work to start with - at the moment, I'm just drawing some rectangle for testing purposes so a PNG may present new difficulties but I haven't got there yet.
What I haven't been able to accomplish is updating the graphic - The first time the form is rendered, it shows perfectly as I'd expect (no border, just some rectangles floating on a desktop). If I move the windows behind the transparent window, the transparent window doesn't update/re-paintI believe that I need to be calling Me.Invalidate() to force a re-draw but am unsure when I should make the call - How do I know a window behind me has changed its' contents?
Edit: I tried putting a Me.Invalidate() inside a timer just to test how the redraw happens - it seems that it does trigger a re-draw but the re-draw opccurs OVER the existing form background - ie an area that was originally 50% opaque is now 75% opaque (50% + 50% of what was there before)So, after a couple of Invalidate()s, my form is showing as a black box - I need to clear the background of the form before re-drawing but Graphics.Clear(Color) seems to simply do a fill with the specified color - and obviously for the purposes of this question, Colors.Transparent doesn't really mean transparent - It seems to be a trick used when rendering the window to "show contents of control beneath this" which just doesn't work when we're dealing with the form itself?
Imports System.Drawing
Public Class TransparentForm
Private Timer As Timers.Timer
[code]....
I have a custom shaped form with a transparency key of black. With the opacity set to 100%, I do not see the garbage around my custom shaped form As soon as I change the opacity, I see a transparent square(my borderless form) around my form.
How do I make it where my form retains its custom shape, and can have an opacity of less than 100%?
If you want something you've never had, you need to do something you've never done.
I'd like to replace all the white pixels in a bitmap image with pixels of the colour "Color.FromKnownColor(KnownColor.MenuHighlight)". Is there some method in the Image, Bitmap or Graphics classes I can use, or will I simply have to inspect each pixel in the image with GetPixel, check whether it is a white pixel, and then set it with SetPixel?Here is the code I am using now:
Private Shared Sub highlight(ByVal b As Bitmap)
Dim highlightColour As Color = Color.FromKnownColor(KnownColor.MenuHighlight)
Dim whiteARGB As Long = Color.White.ToArgb
[code]......
I've tried adding a splash screen ]...to one of my applications and after exploring a while I somehow managed to get it working what bugs me now is that my splash screen is in fact a image inside a picture box and the form always shows the control color behind so what I tried is adding the form color to the transparency key this worked, somehow now, I use a png image that has some transparent effect also what I've noticed is that where I would want to show the transparent effect from the image the transparent color that is set in the forum shows below is the image to get my point of view:
I'm wondering if I can remove that "pink" color (set by me in the forum) from the image .I want to get a effect like the one Adobe products have for example
I am an intern at a company doing Drawing Tools for their program. My supervisor is currently having me just make a user control that draws a line and adds transparency over a form. (I started this internship very early, so my knowledge is very limited compared to what it should be for a standard intern)
This is what I have so far:
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
If MyBG Is Nothing Then
MyBG = New Bitmap(Me.Width, Me.Height)
[CODE]...
How do you change the colour of the title bar?
View 1 RepliesI am trying to change to form backcolor from one colour to another with a time delay of 1 second. I have tried various things without success and this is the best I can come up with:[code]The problem I am getting is the colour is not changing until the loop has finished.
View 3 RepliesI have an MDI form on which I have placed a ToolStripContainer. I have set the BackColor of the toolstripcontainer.contentpanel to an ApplicationsSettings property binding for BackColor. At design time the background colour of the contentpanel reflects the colour in the saved Applications Settings. However at run-time the background colour of the content panel is not the colour that has been saved in the applications settings (in this case DarkSeaGreen). It continues to display the colour from the current
View 2 RepliesThis is what I have..Dim frmSettings As New frmOptionsfrmSettings.ShowDialog(Me)frmSettings is a settings form that you can choose the color for background of form1(Me)
View 1 RepliesI exited out of a form on accident, and now I cant figure how to get it back. When I debug the program, it stiill works, the form is still in the file, I just clicked the "X" to get rid of it. Now I want to edit that form, but it wont let me, because I cant find it.
View 2 RepliesI have 2 forms. Form1 and Form2. When Form2 is closing, how do I make Form2 to inform Form1 that Form2 is closed.
View 2 RepliesI have a CheckingAccountForm and a CheckingAccount class. I have 2 variables AmountEntered and TotalAmount. The user enters an Amount and hits the calculate button. So now I send the AmountEntered to the CheckingAccount class where it is added to the TotalAmount and I have to send the TotalAmount back to the CheckingAccountForm so it can be displayed in a textbox. Can someone give me an example on how to do that? I get the AmountEntered to the CheckingAccount Class and managed to calculate, but not sure how to get the TotalAmount back so I can display it in the GUI's TextBox for the TotalAmount.
View 3 Replies