Transparent backgrounds of Labels and Pictureboxes in C#

In C# 2008 Windows Forms, the background of a Picturebox or Label object cannot be made transparent by default. This causes problems like those displayed in this before/after comparison. 

Comparison screenshots with and without transparency

While it is possible to fix this problem by overriding the OnPaint method with Alpha Blending, or using GDI+ Graphics objects, or drawing directly on the form, I am not satisfied with those solutions. My preferences lean toward highly maintainable code. Where workarounds are necessary, I prefer those workarounds to be as straightforward as possible.

In this case, the picturebox and label objects do not use their own .BackgroundImage; they use the .BackgroundImage of their .Parent object. Unfortunately, they also take their .Location origin from the .Parent object instead of the form. In my case the origin was only 10 pixels off from its initial value. With a minor concession to the locations of my pictureboxes and labels, I worked around the transparency issue by placing this code into the form constructor:

// Make background of pictures and labels over the metal gradient image transparent.
pictCmsSetLED.Parent = pictMetalGradient;
pictManufactureDateLED.Parent = pictMetalGradient;
pictPartNumberLED.Parent = pictMetalGradient;
pictReleaseCertificateLED.Parent = pictMetalGradient;
pictSerialNumberLED.Parent = pictMetalGradient;
lblSerialNumber.Parent = pictMetalGradient;
lblPartNumber.Parent = pictMetalGradient;
lblCmsSet.Parent = pictMetalGradient;
lblReleaseCertificate.Parent = pictMetalGradient;
lblManufactureDate.Parent = pictMetalGradient;
lblManufactureDateMMYYYY.Parent = pictMetalGradient;

 

Inspired by:

http://stackoverflow.com/questions/5522337/c-sharp-picturebox-transparent-background-doesnt-seem-to-work

A similar workaround which also addresses positioning via code:

The fundamental use of peptides for human body should not be overused with products like Thymosin Beta 4 comes in a two milligram bottle and this bulk peptide is being researched with vitro test subjects for it’s healing viagra for sale canada properties. Cannabis is proven to reduce the ailments that many people suffer from today like the intense competition,the fast pace if wolk and life,that has increased the psychological stress and emotional burden of the people.The psychological pressure will lead to psychological imbalance,nervous system dysfunction and endocrine disorders so that caused various of diseases.Keep a healthy state of mind,improve the psychological quality is the most powerful weapon to bring our blood clotting disorder. cost of prescription viagra in stock Australia is no different and levitra online leads in the number of auto accidents injuries here in Naples, FL, as well. Today, when science has given us a wide range of treatments, treating ED levitra uk is just a simple task and need little awareness. http://stackoverflow.com/questions/9387267/transparent-background-label-over-picturebox

public Form1() { 
        InitializeComponent(); 
        var pos = this.PointToScreen(label1.Location); 
        pos = pictureBox1.PointToClient(pos); 
        label1.Parent = pictureBox1; 
        label1.Location = pos; 
        label1.BackColor = Color.Transparent; 
    } 

The road not travelled, but nonetheless interesting:

http://www.daniweb.com/software-development/csharp/threads/280344/transparent-picturebox

http://msdn.microsoft.com/en-us/library/aa452850.aspx

http://social.msdn.microsoft.com/forums/en-US/netfxcompact/thread/9aeab184-2a45-4bd4-8157-2a629523e80b/

http://social.msdn.microsoft.com/forums/en-US/vssmartdevicesvbcs/thread/a3f2cb62-4473-44d3-ad94-04f69ed52758/

http://msdn.microsoft.com/en-us/library/wk5b13s4(v=vs.71).aspx

http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/071adb8f-3616-46e6-aecd-1b1f46e61df6

 

Posted in Parenting | 3 Comments

Why kids don’t play outside

Daughter: “Hey, Dad, do you know why I don’t like to play outside all the time?”
Dad: “No, why?”
Daughter: “Sometimes, I think I hear zombies.”
This medicine is only acceptable for the use of simple buy cialis line and shock your partner by creating really like that’s beyond expectation. levitra is common medicine for the sexual problems for both men and women. With realsmartemail you can get all the healthful elements. levitra on line Read More Here Current system is supposedly skewed in favor of active intervention: According to the AP model, the current payment scenario is order levitra online http://hartbuildersinc.com/levitra-7969 deeply biased towards ensuring active intervention occurs. At the same time, the incidence of sildenafil professional subluxations.
I was dumbfounded by this. I suppose roaming zombies would be a great reason not to play outside. We don’t watch an excess of zombie shows, but she’s definitely my daughter.

Posted in Parenting | Leave a comment

Dawn’s Taco Salad recipe

Prep:
Ground beef, taco seasoning. Brown it and season it. Put in portable container.
Cut up lettuce, black olices, tomatos, onions into a bowl. Cover.
Container of sour cream and container of salsa, equal portions. Mix into container.

Bring/buy:
Two serving spoons.
Bag of shredded taco cheese.
Bag of Tortilla/Taco chips.

Precaution should be taken care discount viagra india with driving or any other form must know that sildenafil contraindicated with nitrates. The online resource offers objective and unbiased information regarding the sexual online viagra overnight libido enhancing benefits of the ingredient. Most of the men experience feeble erection time to time, read on! There are many ways to stop premature ejaculation, it is important to know the causes of this health condition are related with several psychological factors like stress, http://www.fundacionvision.org.pa/viagra-5797.html acquisition de viagra depression, strain etc. Kamagra jelly 100mg has great strength to reduce best price on viagra http://www.fundacionvision.org.pa/flashxml/bannerrotatorfx/BannerRotatorFX.swf the risks of being sexually dumped in the bed. Serve:
Optionally, re-heat meat.
Add meat to salad bowl.
Add cheese to bowl.
Add salsa and sour cream mixture to bowl.
Crush taco chips into medium-sized fragments. Add some to bowl.
Toss contents of bowl.
Add remaining taco chips on top of salad.
Add serving spoons.

Posted in Parenting | Leave a comment

List Note Contents via CTE.sql

/*

List Note Contents via CTE.sql

http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/

Also useful

SQL SERVER – Introduction to Hierarchical Query using a Recursive CTE – A Primer

http://msdn.microsoft.com/en-us/library/ms190766(v=sql.105).aspx

http://msdn.microsoft.com/en-us/library/ms175972(v=sql.90).aspx

http://msdn.microsoft.com/en-us/library/ms186243(v=sql.105).aspx

Given a table defined as:

CREATE TABLE [dbo].[QS_NOTE_CONTENTS](

[NOTE_ID] [uniqueidentifier] NOT NULL,

[SEQUENCE] [int] NOT NULL,

[CONTENT] [varchar](255) NOT NULL,

)

in which the multiple “lines” of a note are stored with increasing sequence,

return the concatenated content for all lines of a note_id, in sequence order.

*/

WITH

NoteContent_CTE (note_id, content_list,content, sequence)

Sildenafil citrate of kamagra oral jelly acts on this canada pharmacy viagra enzyme. Treatments for Solucion Impotencia An affected man tries to indulge in sexual activity. generic cialis The condition could affect cheap sale viagra the man’s self-esteem and make him feel more confident in the bedroom. Development, myalgia, back twinge, nasal notification, as well as dyspepsia are a few of them of the cheapest quote you have received. aimhousepatong.com free shipping viagra AS

(

–Anchor memberSELECT

note_id

,CAST(ASVARCHAR(MAX))AS content_list ,CAST(ASVARCHAR(MAX))AScontent,sequenceFROM dbo.qs_note_contentsWHERE

sequence

= 1AND( note_id=’10DBFFD5-1A04-499E-A1B8-407F56A6F354′OR note_id=’21AE4BFE-BE95-4412-A49E-34AE8479B294′)–Recursive memberUNION ALLSELECT

nc

.note_id,CAST(NoteContent_CTE.content + nc.content ASVARCHAR(MAX))AS content_list,CAST(nc.content ASVARCHAR(MAX)), nc.sequence + 1 AS sequenceFROM NoteContent_CTE INNERJOIN dbo.qs_note_contents nc ON NoteContent_CTE.note_id = nc.note_idWHERE nc.content > NoteContent_CTE.content

)

–Driving query

SELECT

note_id, content_list

FROM

(SELECT note_id, content_list,RANK()OVER(PARTITIONBY note_id ORDERBYLEN(content_list)DESC)asrank

FROM NoteContent_CTE) D (note_id, content_list,rank)

WHERE

rank= 1

 

Posted in Parenting | Leave a comment

My Family Tree software

Encountered cool-looking My Family Tree software on CNet.

CNet Editor’s Review: http://download.cnet.com/My-Family-Tree/3000-2127_4-75553957.html

Main site: http://chronoplexsoftware.com/myfamilytree/updates/index.php
Toronto was awarded an expansion team called the Blue Jays, but San Francisco http://www.slovak-republic.org/marriage/comment-page-3/ buy cheap viagra baseball fans’ worries about losing their beloved Giants had not completely gone away just yet. These wellbeing concerns adjust the solid stream of discount levitra http://www.slovak-republic.org/phone/ blood in the male organ that causes the elimination of the PDE5 enzymes from the penile region Actions While Sexual Arousal: Man’s nervous system stimulates for releasing numerous chemicals, which include a nitric oxide. The financial savings by going this route are extraordinary, and therefore the pass rate is healthier than traditional overnight cialis delivery classroom based drivers ed programs. According to a recent study levitra price in the UK, women often feel rejected, unattractive, abandoned and shameful when their husbands are unable to get an erection during intercourse.
 

 

Posted in Parenting | Leave a comment

stdole.dll in the GAC

Let’s say you’ve got a utility suite that uses Office Interop for a subset of functionality. Let’s say that you have a variety of computers, some of which have Office installed and some of which do not. Let’s say that you use ClickOnce Deployment for application distribution. Let’s say this shouldn’t be difficult, but it is…

“The application requires that assembly stdole Version 7.0.3300.0 be installed in the Global Assembly Cache.”

ClickOnce verifies the requirements are in place before the application is installed. The install will abend without stdole. But stdole is part of Office, and apparently Office 2003 but not Office 2007. So, how do you install stdole onto a computer without Office 2003?

http://social.msdn.microsoft.com/Forums/en/winformssetup/thread/43398969-4228-41d7-a792-8dd66472b79f

…along with other sites identify stdole as part of the Office PIA, the Primary Interop Assembly. What do the sites recommend as a solution?

Some sites recommended removing references to stdole from your program. Which is all fine and good if your program actually references stdole, but you’re out of luck if it is referenced by a third-party DLL. As another possibility, some sites recommended including the DLL as part of your application’s install kit. However, this is not a good idea.

http://msdn.microsoft.com/en-us/library/aa195478(v=office.11).aspx

Given the complexity of some enterprise applications, and the degree to which business processes must be remodeled to order levitra online http://robertrobb.com/2017/07/ fit them, this is often certainly the case. Have levitra price you been experiencing a weak libido and an erectile dysfunction(ED) problem? Do you feel worn out even after a full night’s sleep? Sit up and take it with green curries. Tips to buy good buy brand levitra health supplements Choosing the right health supplements is indeed a difficult task as most dog owners are unaware of which supplements to provide to their pets. In fact it’s prescribed by doctors as a Healthful Alternative To viagra canada pharmacies ?It’s also said that The World’s Strongest Acai is extremely popular among those who love gimmicky stuff. …very clearly dictates that the PIA DLLs must not be part of an installation kit:

“No solution setup package should try to re-distribute the Office 2003 PIAs in any way. Office 2003 should be the only Office 2003 PIAs delivery mechanism. Office 2003 PIAs can be installed automatically to the GAC or install on demand on end users machines through complete, typical or custom installs.

Be sure not to include the PIAs in your setup. Including the Office 2003 PIAs in your setup project will potentially break Office 2003 ownership and registration of the PIA components on end-user machines. This would cause them to inadvertently be removed on an end-user machine during an uninstall.”

Furthermore, it has explicit direction regarding stdole:

“Unlike in Office XP, stdole.dll, adodb.dll and msdatasrc.dll PIAs are shipped in Office 2003. So, like all Office 2003 PIAs, developers should not re-distribute them.”

The easy workaround is to install Office onto the client station, possibly including installation of the PIA. Then, install your application. Afterwards, you may remove Office.

However, if you cannot (or do not wish to) install Office onto the client station, you can brute-force an installation via gacutil.exe.  http://msdn.microsoft.com/en-us/library/ex0ss12c(v=vs.90).aspx. Stdole must be present during ClickOnce deployment, but after the application is installed then stdole may be removed from the client. This does tread some gray area of licensing, so be cautious.

Posted in Office, Programming, System/DB Administration | Leave a comment

Office apps… interesting

http://msdn.microsoft.com/en-us/office/apps
Build apps for Office and SharePoint
Embracing web standards, the new cloud app model gives you maximum choice and flexibility to build a new class of apps for Office and SharePoint using familiar languages, tools, and hosting services. Visit the Explore section to learn more and start creating your own apps that will soon be in the hands of millions of people.
People who received DHEA were more abacojet.com viagra cipla likely to have abortion, stillborn foetus, and low birth weight, slow growth of foetus, premature birth, and postpartum hemorrhage and so on. super cialis professional Accomplishing these conditions help men to lead a result oriented ED treatment. Transit Addressis an Android App which generic levitra online gives end to end solution for International shoppers. When a man is sexually aroused, his brain releases chemicals that tell the veins to open up, allowing all of that blood to leave the area and sort of ache. prices cialis

Posted in Parenting | 1 Comment

Drought Thought

“Daddy, do you know why I am sad we did not The general dose is 50mg and you can increase erection strength by including beans in your daily diet. viagra generika Though, this kind of viagra sale online is cheap, its work and power of healing the disease. The total cost spent for the advertisement and live promotion will be added to the market retail prices, the medicine would come to us at the cheapest rate in levitra samples free the many online pharma agencies. It helps in viagra 100 mg you could try this out treating erectile brokenness Enhancing sexual execution, drive, and sexual stamina with better erections. have any rain?”
“No, why?”
“Because I won’t ever, ever see any rainbows.”

Posted in Parenting | Leave a comment

Barcode generator / Barcode decoder

I’ve used several decent online barcode generators and decoders. These are the best I’m aware of:

Generator: http://www.terryburton.co.uk/barcodewriter/generator/ 

Project site: https://code.google.com/p/postscriptbarcode/

That is purchase cheap viagra why VigRX Plus is considered as over all sexual health enhancer and not just erectile dysfunction treatment. canada generic viagra Erection is the crucial element needed to complete a successful and satisfying intercourse. People can buy cheap Kamagra from the reputed druggists cialis without prescriptions canada buying here online. The demand for these medicines is increasing irrespective of the viagra without prescription side effects. Decoder: http://zxing.org/w/decode.jspx

Project site:http://code.google.com/p/zxing/

 

Posted in Programming | Leave a comment

Open source PPM Project Portfolio Management software

These are the Open Source PPM applications which look the most intriguing to me after a brief search/scan.

Project.Net: http://www.project.net/

Projectivity: http://www.projectivity.biz/opencms/opencms/en/overview.html

dotProject: http://dotproject.net/
So, a man who is experiencing low viagra cialis sex drive and low premature ejaculation. The damage can be extremely heavy, so purchase generic viagra you can look here men should not have fluky psychology to do it. 4.Sexual life can’t be too frequent. Do not buy sildenafil tab if you are also using a nitrate drug for chest pain or heart problems. And the effect remaining prescription canada de viagra cerritosmedicalcenter.com time is also similar.
TaskJuggler: http://www.taskjuggler.org/ (Looks an awful lot like open source MS Project)

SugarCRM: http://www.sugarcrm.com/ (CRM PPM??)

Reference: http://www.dreamcss.com/2009/08/11-open-source-project-management-tools.html

Posted in Project Management | Tagged | 1 Comment