How to Set/Change Transparency to CEdit control?

Hi,
How to set/change Transparency to Custom Edit control. Can I use
SetLayeredWindowAttributes() to set alpha factor for CEdit control?
Can I use WS_EX_LAYERED style to child (CEdit) controls?
Or should I use GDI+ library feature
(Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not
working for me.
0
5/22/2008 4:48:41 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
1544 Views

Similar Articles

[PageSpeed] 49

Since the edit control is drawn with GDI, invoking a GDI+ mechanism is not going to be
terribly successful.  While you might consider subclassing the edit control and returning
a NULL_BRUSH, this will not produce satisfactory results because edit controls are drawn
with SetBkMode(OPAQUE) and changing that to TRANSPARENT will result in complete garbage on
the screen.  I would have suspected WS_EX_LAYERED with the appropriate alpha blending
selection, but since edit controls live in their own world, this probably won't work,
either.

I'm not sure it can be made to work in systems < Vista.
				joe
On Thu, 22 May 2008 09:48:41 -0700 (PDT), sujeet27kulk@gmail.com wrote:

>Hi,
>How to set/change Transparency to Custom Edit control. Can I use
>SetLayeredWindowAttributes() to set alpha factor for CEdit control?
>Can I use WS_EX_LAYERED style to child (CEdit) controls?
>Or should I use GDI+ library feature
>(Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not
>working for me.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
5/22/2008 4:53:44 PM
On May 22, 9:53=A0pm, Joseph M. Newcomer <newco...@flounder.com> wrote:
> Since the edit control is drawn with GDI, invoking a GDI+ mechanism is not=
 going to be
> terribly successful. =A0While you might consider subclassing the edit cont=
rol and returning
> a NULL_BRUSH, this will not produce satisfactory results because edit cont=
rols are drawn
> with SetBkMode(OPAQUE) and changing that to TRANSPARENT will result in com=
plete garbage on
> the screen. =A0I would have suspected WS_EX_LAYERED with the appropriate a=
lpha blending
> selection, but since edit controls live in their own world, this probably =
won't work,
> either.
>
> I'm not sure it can be made to work in systems < Vista.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 joe
>
> On Thu, 22 May 2008 09:48:41 -0700 (PDT), sujeet27k...@gmail.com wrote:
> >Hi,
> >How to set/change Transparency to Custom Edit control. Can I use
> >SetLayeredWindowAttributes() to set alpha factor for CEdit control?
> >Can I use WS_EX_LAYERED style to child (CEdit) controls?
> >Or should I use GDI+ library feature
> >(Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not
> >working for me.
>
> Joseph M. Newcomer [MVP]
> email: newco...@flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm

Hi,
On CodeProject (http://www.codeproject.com/KB/winsdk/quaker1.aspx) in
the message board of this article on Transparency it is mentioned that
- > parent must have WS_EX_COMPOSITED for this
(SetLayeredWindowAttributes() and  WS_EX_LAYERED)  to work on child
windows. This is only supported on XP <---  but below its mentioned
that its not working. So is there any other way to change the
transparency of CEdit control? Or CEdit controls transparency can't be
changed on Windows at all?
0
5/22/2008 5:10:32 PM
Here is an example of how to do it:

http://www.learnstar.com/AliR/TransparentEdit.zip

AliR.


<sujeet27kulk@gmail.com> wrote in message 
news:45850af2-4ff6-4276-ae8f-42b37e4db803@y22g2000prd.googlegroups.com...
> Hi,
> How to set/change Transparency to Custom Edit control. Can I use
> SetLayeredWindowAttributes() to set alpha factor for CEdit control?
> Can I use WS_EX_LAYERED style to child (CEdit) controls?
> Or should I use GDI+ library feature
> (Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not
> working for me. 


0
AliR3470 (3235)
5/22/2008 6:44:13 PM
On May 22, 11:44=A0pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Here is an example of how to do it:
>
> http://www.learnstar.com/AliR/TransparentEdit.zip
>
> AliR.
>
> <sujeet27k...@gmail.com> wrote in message
>
> news:45850af2-4ff6-4276-ae8f-42b37e4db803@y22g2000prd.googlegroups.com...
>
>
>
> > Hi,
> > How to set/change Transparency to Custom Edit control. Can I use
> > SetLayeredWindowAttributes() to set alpha factor for CEdit control?
> > Can I use WS_EX_LAYERED style to child (CEdit) controls?
> > Or should I use GDI+ library feature
> > (Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not
> > working for me.- Hide quoted text -
>
> - Show quoted text -

Hi,
 Thanks. But I want a blending factor( alpha factor). This way it will
be either Transparent or Opaque.
0
5/23/2008 6:28:46 AM
you can see at
http://www.codeproject.com/KB/dialog/SkinDialog.aspx
http://www.codeproject.com/KB/winsdk/QDWndTransparency.aspx?df=100&forumid=26287&exp=0&select=895561

it can be useful to you, it make transparent a dialog, maybe button also.

<sujeet27kulk@gmail.com> wrote in message 
news:649f2b1e-4e37-4b69-991a-1b136e9c8244@p39g2000prm.googlegroups.com...
On May 22, 11:44 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Here is an example of how to do it:
>
> http://www.learnstar.com/AliR/TransparentEdit.zip
>
> AliR.
>
> <sujeet27k...@gmail.com> wrote in message
>
> news:45850af2-4ff6-4276-ae8f-42b37e4db803@y22g2000prd.googlegroups.com...
>
>
>
> > Hi,
> > How to set/change Transparency to Custom Edit control. Can I use
> > SetLayeredWindowAttributes() to set alpha factor for CEdit control?
> > Can I use WS_EX_LAYERED style to child (CEdit) controls?
> > Or should I use GDI+ library feature
> > (Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not
> > working for me.- Hide quoted text -
>
> - Show quoted text -

Hi,
 Thanks. But I want a blending factor( alpha factor). This way it will
be either Transparent or Opaque. 


0
vietdoor (39)
5/26/2008 7:42:43 AM
On May 26, 12:42=A0pm, "James Duy Trinh" <vietd...@gmail.com> wrote:
> you can see athttp://www.codeproject.com/KB/dialog/SkinDialog.aspxhttp://w=
ww.codeproject.com/KB/winsdk/QDWndTransparency.aspx?df=3D100&fo...
>
> it can be useful to you, it make transparent a dialog, maybe button also.
>
> <sujeet27k...@gmail.com> wrote in message
>
> news:649f2b1e-4e37-4b69-991a-1b136e9c8244@p39g2000prm.googlegroups.com...
> On May 22, 11:44 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
>
>
>
>
>
> > Here is an example of how to do it:
>
> >http://www.learnstar.com/AliR/TransparentEdit.zip
>
> > AliR.
>
> > <sujeet27k...@gmail.com> wrote in message
>
> >news:45850af2-4ff6-4276-ae8f-42b37e4db803@y22g2000prd.googlegroups.com...=

>
> > > Hi,
> > > How to set/change Transparency to Custom Edit control. Can I use
> > > SetLayeredWindowAttributes() to set alpha factor for CEdit control?
> > > Can I use WS_EX_LAYERED style to child (CEdit) controls?
> > > Or should I use GDI+ library feature
> > > (Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not
> > > working for me.- Hide quoted text -
>
> > - Show quoted text -
>
> Hi,
> =A0Thanks. But I want a blending factor( alpha factor). This way it will
> be either Transparent or Opaque.- Hide quoted text -
>
> - Show quoted text -

Hi,
     Thanks. I am thinking on the same lines i.e to place CEdit on the
top of a CWnd object of same size.So that Changing Transperancy for
that Parent window will automatically make CEdit box Transparent.
0
5/26/2008 1:43:15 PM
Reply:

Similar Artilces:

How do I set up an argument which asks for multiple criteria
I am trying to use an argument that asks for one of three criteria (2345P, 8319T, or 7026J) in cell C108, and if it finds it, enters the amount of yet another cell, G108 into cell K108, and if not enters 0 into cell K108. It seems there are too many arguments for the "if" argument, and I can't seem to get the "lookup" argument to work either. Is there another argument I should be working with? Thanks -- Diver Try: =IF(OR(C108="8319T",C108="2345P",C108="7026J"),G108,0) "bj" wrote: > try in K108 > =if(or(c108=&qu...

setting up new outlook mail account
i can not set up a new account on my outlook, i keep saying establish network connection with a correct sign but searching for my mail account shows X can you please advise Are you trying to setup a POP3 mail account or an Exchange account? Also, what version of Outlook are you using? "rashid" <rashid@discussions.microsoft.com> wrote in message news:C59D04C0-C1C9-4BD1-AE00-2009D25B221D@microsoft.com... > i can not set up a new account on my outlook, i keep saying establish > network > connection with a correct sign but searching for my mail account shows X > ...

Changes in Appearance & Placement
When I created the .pub document, I got it looking just the way I wanted and published it to the web via ftp. When I went online and viewed it, the document appears changed. Some of the text looks all fuzzy and low quality, some of the lines have moved, things don't look the same. Pardon my honesty. This is the first time I have used Publisher. This is the first website I've made in ~10 years since I took an html class and made a class project "website". I'm only just figuring out what I'm doing along the way. When I asked around, what I was told is that Publish...

how can I change the scale of the numbers in my chart data table?
I have set up a simple graph, and I have opted to show a data table at the bottom which shows my graph results numerically. However, whilst I have changed the scale on the value axis with no problem, I cannot change the scale of my data table to thousands.. the only option I seem to have is to be able to format the font. Please can you help? A chart data table has very limited capability. Instead of using one, consider simulating the effect. See Custom Chart Table http://www.tushar-mehta.com/excel/newsgroups/data_table/index.htm -- Regards, Tushar Mehta www.tushar-mehta.com Excel,...

OWA Set Rule problem
I have successfully install the Exchange 2003 with SP1 in the Windows Server 2003. Anything alright exclude the rules function in OWA. I try to set the rules from any then "move to" or "copy to" specify folder are no problem, but "forward to" other email address, its don't work. I try to input the email address in the contact and then select from the contact, but the result also don't work. The rules can save and I can receive the incoming email in the Exchange 2003/Outlook or OWA, but it don't forward to my specify email address. I try to...

How do I set the 'Set Synchronizing Client' field
We have a number of outlook clients using CRM that have the 'Set Synchronizing Client' select box greyed out. We need to tick them so that they are able to synchronize tasks etc. Can any one help me find out why these are greyed out and then set them so that they can synchronize thanks In my experience, that checkbox is always greyed out for the first install that is performed for a user. The only time that checkbox becomes active is if a second copy of CRM is installed for a user who already has CRM installed on another PC.... Normally the box is checked and grey. If that is...

How to set backcolour
Hello All I have a continuous form containing a number field (long integer) called [v_colour]. This field contains the number of a certain colour - as per the numbers that are used in the format properties for back colour etc. I would like to set the back colour for the form's [v_colour] text box to be the value of the field: e.g. If the value of [v_colour] in the first record is 255, I want the back colour of the textbox for that record to be bright red. I tried this as the OnLoad event for the form: [v_colour].backcolour = [v_colour].value .... but this resulted in the back colour of...

Changing Default Recipient Policy
Can anyone please help me out and point out any risks that are involved in changing the Default Recipient Policy? What exactly are trying to accomplish? -- John Oliver, Jr MCSE, MCT, CCNA Exchange MVP 2007 Microsoft Certified Partner "Help" <Help@discussions.microsoft.com> wrote in message news:6CF17444-BCBE-414F-9950-FB5B3EF78FF0@microsoft.com... > Can anyone please help me out and point out any risks that are involved in > changing the Default Recipient Policy? > Our default policy is @companyname.local and will not send NDR's externally. http://suppo...

controls go dead
I have an application that goes into a loop and waits (using WaitCommEvent) for data to come into the serial port. My problem is that once I enter that loop, all my CButton's go stupid. The checkbox won't check, the OK and Cancel buttons don't work. Below is the code in question, post a note if this is not enough info. These Functions are all part of a CDialog class--PickOps.cpp while(m_PauseCheckBox.GetState() == BST_UNCHECKED){ controllerResponse = ""; //Tells controller to begin polling waitForAnswer(&controllerResponse); if(m_Pau...

internet options change and ie 8
i have ie 8 and have noticed that my internet options icon changes and im wondering what that means. the icon is a globe type image and then for some reason not of my doing (as far as i know) it changes and has a white square in front of the globe and the square has a check mark on it. its probably not a big deal but im just curious what it is doing and what it means. thank you in advance. kf. "kf" <kf@discussions.microsoft.com> wrote in message news:4F1B7252-67A7-4BEF-8BB6-983C8B8C2026@microsoft.com... > i have ie 8 and have noticed that my internet o...

Applying Percent Decrease Across Set Periods
I have a column which includes dates when items were purchased. I have used the DATEDIF function to find the number of years between that date and today's date. I now want to decrease the purchase amount 10% for every year calculated via the DATEDIF function. Any ideas, is this possible, why can't I think...? -- Hunt&amp;Peck ------------------------------------------------------------------------ Hunt&amp;Peck's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=32961 View this thread: http://www.excelforum.com/showthread.php?threadid=527873 ...

Set Regional Settings but not Language
Hi I have a multi-language APP en-US, es-ES, it-IT I usually change Languages and Locales by using the CultureInfo to switch Languages System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("es-ES"); My issue is - what if the user wants to View App in english and use the Regional Options on a PC in say Spain ??? If I change the CultureInfo to en-US then they can view APP in English ( English satelite assemblies) but date and numbers will be in US format If I change the CultureInfo to es-ES then date and numbers will be in Spain forma...

Active X control
Hi All, I am trying to make a dialog based ActiveX control in VC++ using MFC. I inserted buttons, radio buttons, and a FlexGrid control in this ActiveX. But when I run this control in a client application, the control disappears. If I remove Flexgrid, the control is displayed but when I press any button on this control, program hangs. Where is it that I might be going wrong? Would highly appreciate a solution or suggestion regarding this. TestHim wrote: > Hi All, > I am trying to make a dialog based ActiveX control in VC++ > using MFC. I inserted buttons, radio buttons, and ...

Work Hours setting excludes specified hours from Scheduling
I am miffed by this problem. I specify a work hour schedule for a user. When I schedule a CRM User as a Resource for a Service in Scheduling of a Service Activity with Requested Time of ASAP and click Find Available Times, the values for Avilable Times returned are outside of the Work Hours I specified for the user and not within the work hours. When I drill into the Work Hours for this User, the Calendar view shows Cross Day rather than 8:00AM - 5:00PM I speciied for work hours and editing the hours reveal the correct hours in the Work Hours. What gives? Never mind. Figured out w...

Reading Pane Settings
I did a search for an answer to this question and have not found one. If I missed an answer already posted, please direct me to the right place. I have Outlook 2007 and set up the "right" reading pane for my e-mail. Now when I go to my calendar it is set up the same way - calendar on the left (same size as the inbox) and then there is a blank space to the right that is the size of the reading pane/preview. To the right is the to-do bar (which I have no problem with). I don't know why there is a reading/preview pane on the calendar when there is nothing to preview, and I...

How do I create a template where the header cannot be changed?
WORD - Not powerpoint I am creating a MS word 2007 template and am having trouble with the headers and footers. I have put a section break in the first page and ticked different first page. How do I lock the headers and footers - if I delete any text between page 1 and two the headers disappear. Can you help? Why not post your question in one of the Word groups, since it's a Word question? -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 ...

Outlook "Arrange By" option does not retain its setting
In outlook 2007, I use a custom view for my inbox, and I have the Group By option checked to"Automatically group according to arrangement." This has been workn flawlessly until today, when I realized Outlook did not like a particular mouse click; perhaps I clicked on the border of two options or some other anomoly that caused the window toflash once. The end result was that my Arrange By option changed to "From" when I had previously set it to "Conversation." Now, whenever I hange it backto "Conversation," leave the inbox and come back, ...

How to Change Defualt Search Engine?
Does anyone know how to change the default search engine that appears when clicking on the "Search the Web" button on the Web toolbar from within Outlook 2002? Currenlty when I click that button, I get MSN search engine. I would like to change to Google. Thanks! I believe you would have to set the following registry keys. [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main] "Search Page"="http://www.google.com" "Search Bar"="http://www.google.com/ie" [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchURL] "...

Propagate Lead Form Changes
I added some new values for Lead Source in the Lead form yesterday. My IT manager who's unavailable and normally does this sort of thing told me that many changes like this just "take a while" to propagate out system wide. How long does it take, or do I need to do something to publish my changes? I can see that they're saved because if I go back to edit the values for that field, they're all in there. Thanks Nathan, You need to publish the changes from the deployment manager. Usually you need to restart IIS (just Start - Run - iisreset will do the trick). T...

interactive buttons, multiple sets
hi folks I'm sure one of you good folks will save my bacon as usual I have a series of websites, all of which exhibit the same odd behavior with interactive buttons. I have a bunch of buttons in the left margin, each of which pulls up ( lets call it ) a chapter, and in each 'chapter' are a number of related pages. On the top of each page is an imbedded page which has 'page numbers' for all the 'pages' in that chapter. So, it's a grid where the 'vertical' buttons in the left margin and the 'horizontal' buttons at the top comb...

How do I set OOR
I have searched the help menu and have had no luck finding out how to set my outlook 200 to send an OOR (Out of Office Reply) Any assistance would be great If you are in an Exchange environment (ask your administrator if you do notknow) you can set the Out of the Office Assistant which is located under Tools. If you are not in an Exchange environment you can create a rule that replies on all e-mails. The downside of this is that you'll have to have your Outlook open all the time for the rules to process. Make sure you set some exceptions (for instance based on the subject field so ...

Set Focus
I have text box that I input data into and I was wondering if it is possible to set focus to the text box and avoid clicking on the box. I thought the term is Set Focus, but can't find any information or example that would help in doing so. Any help would be appreciated .. PPT 2003. Look at the following page for code to set focus on a text box: http://officeone.mvps.org/vba/activate_shape.html - Chirag PowerShow - View multiple PowerPoint slide shows simultaneously http://officeone.mvps.org/powershow/powershow.html "Phil K" <PhilK@discussions.microsof...

Set published amount of calendar information
Hey guys! Is there any way I can have Exchange 2000/2003 force the amount of time published in the outlook calendar? I know that you can go into the the calendar options and set the amount you want published, but is there a way to have exchange require the amount that is published so that I could get everyone to publish a year's worth of calendar data instead of one person being set at 2 months and another at 6 months and another at 12? Thanks! Mike On Thu, 29 Jun 2006 06:18:02 -0700, Mike <Mike@discussions.microsoft.com> wrote: >Hey guys! > >Is there any way I c...

SmartList builder changes not being recognized.
We created a new report using SmartList Builder and gave the applicable users the security to use it. But when changes are made to the smartlist, only the sa logonid gets the "SmartList Builder has detected changes to be made" popup window. Not sure what I am missing here, has to be a security issue. If I log in as sa, I get the window, as myself I do not (same PC). In SLB are some security options. One of the options is where you can define per class or user what options they have, like updating SmartList with changes. -- Charles Allen, MVP "AJC" wrote: &g...

Changing a CDialogBar button
Hi. My application has a CDialogBar which has a few buttons. The CDialogBar is loaded from a resource. I'm interested in changing / adding / removing buttons in run time (in CMainFrame::OnCreate for instance), but i have no clue as to where to start. Any pointers ? Ori wrote: > Hi. > My application has a CDialogBar which has a few buttons. > The CDialogBar is loaded from a resource. > I'm interested in changing / adding / removing buttons in run time (in > CMainFrame::OnCreate for instance), > but i have no clue as to where to start. > Any pointers ? CMainFram...