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

C#

 
GeneralRe: Get Path & File name using OpenFileDialog Pin
Nick Parker22-Nov-03 2:04
protectorNick Parker22-Nov-03 2:04 
GeneralRe: Get Path & File name using OpenFileDialog Pin
Steve McLenithan22-Nov-03 2:12
Steve McLenithan22-Nov-03 2:12 
GeneralRe: Get Path & File name using OpenFileDialog Pin
leppie22-Nov-03 3:15
leppie22-Nov-03 3:15 
GeneralRe: Get Path & File name using OpenFileDialog Pin
Steve McLenithan22-Nov-03 4:36
Steve McLenithan22-Nov-03 4:36 
GeneralRe: Get Path & File name using OpenFileDialog Pin
Heath Stewart22-Nov-03 4:26
protectorHeath Stewart22-Nov-03 4:26 
GeneralRe: Get Path & File name using OpenFileDialog Pin
Steve McLenithan22-Nov-03 4:34
Steve McLenithan22-Nov-03 4:34 
GeneralIcon Background Pixels Pin
Tristan Rhodes22-Nov-03 1:32
Tristan Rhodes22-Nov-03 1:32 
GeneralRe: Icon Background Pixels Pin
Heath Stewart22-Nov-03 4:34
protectorHeath Stewart22-Nov-03 4:34 
On XP or 2003, right? The problem is that the icon functions get the best icon to display in Windows. Since XP introduced alpha channels on icons, you're getting the icon with the alpha channel. Unfortunately, unless you bind to common controls 6 (.NET's System.Widnows.Forms controls are just wrappers around these), alpha blending isn't performed and you see the alpha channel as a solid color.

There's a couple different things you can do:
  1. Enable theming in your app (which binds to comctl32 version 6).
  2. Read the icons and remove the alpha pixels. It's not as simple as it sounds, though. You have to also use an unsafe context for optimal performance. Christian Graus here on CP has several good articles about image manipulation.
As far as enabling theming in your app, if you are using .NET 1.1 call Application.EnableVisualStyles() before calling Application.Run() in your app's entry point (Main). If you aren't using .NET 1.1 or your app could run on either 1.0 or 1.1, see my article, Windows XP Visual Styles for Windows Forms[^]. You can either embed the manifest file as a Win32 resource (not a .NET embedded resource) or keep it as a separate file that is named myappname.exe.manifest (same convention as .conf files but with a different extension).

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Icon Background Pixels Pin
Tristan Rhodes22-Nov-03 7:17
Tristan Rhodes22-Nov-03 7:17 
GeneralRe: Icon Background Pixels Pin
Heath Stewart22-Nov-03 11:21
protectorHeath Stewart22-Nov-03 11:21 
GeneralRe: Icon Background Pixels Pin
Tristan Rhodes22-Nov-03 12:09
Tristan Rhodes22-Nov-03 12:09 
GeneralRe: Icon Background Pixels Pin
Heath Stewart24-Nov-03 3:43
protectorHeath Stewart24-Nov-03 3:43 
GeneralListing ODBC sources in a drop-down list box Pin
NikV22-Nov-03 1:28
NikV22-Nov-03 1:28 
GeneralRe: Listing ODBC sources in a drop-down list box Pin
Heath Stewart22-Nov-03 4:53
protectorHeath Stewart22-Nov-03 4:53 
GeneralRe: Listing ODBC sources in a drop-down list box Pin
NikV22-Nov-03 12:49
NikV22-Nov-03 12:49 
GeneralRe: Listing ODBC sources in a drop-down list box Pin
Heath Stewart24-Nov-03 3:49
protectorHeath Stewart24-Nov-03 3:49 
GeneralRe: Listing ODBC sources in a drop-down list box Pin
Nick Parker23-Nov-03 3:22
protectorNick Parker23-Nov-03 3:22 
GeneralRe: Listing ODBC sources in a drop-down list box Pin
Nik Vogiatzis23-Nov-03 11:28
Nik Vogiatzis23-Nov-03 11:28 
GeneralCustomizing buttons Pin
rul30321-Nov-03 13:57
rul30321-Nov-03 13:57 
GeneralRe: Customizing buttons Pin
A.Wegierski21-Nov-03 17:54
A.Wegierski21-Nov-03 17:54 
GeneralRe: Customizing buttons Pin
Heath Stewart22-Nov-03 4:46
protectorHeath Stewart22-Nov-03 4:46 
QuestionHow to access command prompt Pin
Anonymous21-Nov-03 10:17
Anonymous21-Nov-03 10:17 
AnswerRe: How to access command prompt Pin
obelisk2921-Nov-03 10:35
obelisk2921-Nov-03 10:35 
GeneralWıindows does not shut down! Heelp! Pin
Utku KAYA21-Nov-03 9:00
Utku KAYA21-Nov-03 9:00 
GeneralRe: Wıindows does not shut down! Heelp! Pin
Daniel M. Edwards21-Nov-03 13:13
Daniel M. Edwards21-Nov-03 13:13 

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.