Click here to Skip to main content
15,888,802 members
Home / Discussions / C#
   

C#

 
AnswerRe: Picture in DataGrid With Every Category Pin
Christian Graus10-Apr-07 22:50
protectorChristian Graus10-Apr-07 22:50 
GeneralRe: Picture in DataGrid With Every Category Pin
sheebalam11110-Apr-07 22:57
sheebalam11110-Apr-07 22:57 
GeneralRe: Picture in DataGrid With Every Category Pin
Christian Graus10-Apr-07 23:05
protectorChristian Graus10-Apr-07 23:05 
Questionhelp here...open file from different directory Pin
Missy Glory10-Apr-07 22:35
Missy Glory10-Apr-07 22:35 
AnswerRe: help here...open file from different directory Pin
Christian Graus10-Apr-07 22:42
protectorChristian Graus10-Apr-07 22:42 
Questionhow to create Control Array in ASp.net(web) form using c# Pin
jaganil10-Apr-07 22:22
jaganil10-Apr-07 22:22 
AnswerRe: how to create Control Array in ASp.net(web) form using c# Pin
Christian Graus10-Apr-07 22:29
protectorChristian Graus10-Apr-07 22:29 
QuestionTransparency in windows forms - doesn't work on some pcs Pin
Delta-Z10-Apr-07 21:59
Delta-Z10-Apr-07 21:59 
Hi I have created an application with transparent main window that displays some text. To initially display and change the text, I use the following code:
if (behavior.IsVisible)
{
                Show();
                mImage = new Bitmap(Width, Height);
                Graphics dc = Graphics.FromHwnd(Handle);
                dc.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
                SizeF size = dc.MeasureString(behavior.DisplayText, behavior.Font);
                dc.Dispose();

                Height = (int)size.Height + 1;
                Width = (int)size.Width + 1;
                mImage = new Bitmap(Width, Height);
                dc = Graphics.FromImage(mImage);
                dc.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;

                Color background = (behavior.Color.ToArgb() == Color.White.ToArgb()) ? Color.Black : Color.White;
                dc.Clear(background);

                dc.DrawString(behavior.DisplayText, behavior.Font, new SolidBrush(behavior.Color), 0, 0);
                mTextColor = behavior.Color.ToArgb();

                dc.Dispose();

                BackgroundImage = mImage;
                TransparencyKey = background;
}
else
{
                Hide();
                BackgroundImage = null;
}


For some reason the window shows transparent on my PC and at least one other, while on most I still get a white background (i.e. no transparency). The only difference I can think of is that on the PCs where the transparency displays correctly, VS2005 is installed, while it's VS2003 or none on the others (I'm using latest video drivers etc).
Does anyone know of this issue and how to fix it?



Thanks,
Dmitry
AnswerRe: Transparency in windows forms - doesn't work on some pcs Pin
blackjack215010-Apr-07 22:07
blackjack215010-Apr-07 22:07 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Delta-Z10-Apr-07 22:09
Delta-Z10-Apr-07 22:09 
AnswerRe: Transparency in windows forms - doesn't work on some pcs Pin
Martin#10-Apr-07 22:14
Martin#10-Apr-07 22:14 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Delta-Z10-Apr-07 22:28
Delta-Z10-Apr-07 22:28 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Martin#10-Apr-07 22:39
Martin#10-Apr-07 22:39 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Stevo Z10-Apr-07 22:42
Stevo Z10-Apr-07 22:42 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Martin#10-Apr-07 22:58
Martin#10-Apr-07 22:58 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Stevo Z10-Apr-07 23:10
Stevo Z10-Apr-07 23:10 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Martin#10-Apr-07 23:38
Martin#10-Apr-07 23:38 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Stevo Z10-Apr-07 23:51
Stevo Z10-Apr-07 23:51 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Martin#11-Apr-07 0:08
Martin#11-Apr-07 0:08 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Stevo Z11-Apr-07 0:26
Stevo Z11-Apr-07 0:26 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Martin#11-Apr-07 1:05
Martin#11-Apr-07 1:05 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Stevo Z11-Apr-07 1:33
Stevo Z11-Apr-07 1:33 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Delta-Z11-Apr-07 1:37
Delta-Z11-Apr-07 1:37 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Martin#11-Apr-07 2:12
Martin#11-Apr-07 2:12 
GeneralRe: Transparency in windows forms - doesn't work on some pcs Pin
Stevo Z11-Apr-07 2:21
Stevo Z11-Apr-07 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.