System.Windows.Controls.Button vs System.Windows.Forms.Button

Using a Button control, I tried to reset its colour ("color" to those of you 
on the other side of the pond). I tried to use the BackColor attribute - but 
that is in System.Windows.Forms.Button.
When I add "using System.Windows.Forms" I get an ambiguous usage error, 
seeing as I am also "using System.Windows.Controls".

I thought it would be hoping too much to cast from  
System.Windows.Controls.Button to System.Windows.Controls.Button or even cast 
back to a UIElement and then to System.Windows.Controls.Button seeing as that 
is not its base class.
Any ideas?

0
9/21/2007 8:44:00 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
990 Views

Similar Articles

[PageSpeed] 59

I might as well answer my own question:

b.Background = System.Windows.Media.Brushes.Red;

Don't want to use System.Drawing.Brush, so either exlipicitly route it, or 
"using System.Windows.Media.Brushes.

"ZiggyShort" wrote:

> Using a Button control, I tried to reset its colour ("color" to those of you 
> on the other side of the pond). I tried to use the BackColor attribute - but 
> that is in System.Windows.Forms.Button.
> When I add "using System.Windows.Forms" I get an ambiguous usage error, 
> seeing as I am also "using System.Windows.Controls".
> 
> I thought it would be hoping too much to cast from  
> System.Windows.Controls.Button to System.Windows.Controls.Button or even cast 
> back to a UIElement and then to System.Windows.Controls.Button seeing as that 
> is not its base class.
> Any ideas?
> 
0
9/24/2007 9:36:03 AM
Reply:

Similar Artilces:

How to lock and unlock the XP system from remote system.
Hi I am writting a program to lock and unlock the remote desptop.For this I need some help related to sending Ctrl+Alt+Del to the remote PC.Can any one help me on the issue. Regards Prashant Sharma Yes. Find something else to do with your time. You keep trying to do something that any decent security system forbids. There is already remote access. See if you can find APIs relating to remote access. But I suspect that you will discover that Windows security is going to make this task impossible. joe On Wed, 18 Apr 2007 15:19:31 +0530, "ISDC" <satish7684@hotmail.com&...

How to impersonate to Local System Account (SYSTEM)
My service is configurated as the Administrators acount. I need to impersonate the service to Local System Account (SYSTEM) in some circumtances. How? Thanks very very much indeed lauch ...

Windows 2000 SMTP
If this is not the correct forum for Windows 2000 SMTP questions, I apologize. I need help diagnosing an SMTP message failure. The email was sent via a Windows 2000 workstation running the SMTP service. The recipient does not receive any message and we receive the following failure notice which does not give me any clue as to what the problem is. (I've changed the addresses). Reporting-MTA: dns;WEBBD.McTeens.com Received-From-MTA: dns;WEBBD.McTeens.com Arrival-Date: Fri, 16 Jan 2004 16:38:04 -0500 Final-Recipient: rfc822;dolly@downtownusalille.com. Action: failed Status: 5.1.3 When I ...

TRANFER mail from outlook express to Windows Mail(windows 7)
Hi- I have just bought a new WINDOWS 7 PC and transferred my OUTLOOK EXPRESS (WINDOWS XP) to my new machine . I cannot find my old folders or mail -I can see IMPORTED Folder1 and Imported Folder2 -but they are all blank .I did get a load of imported mail in my Inbox ? Any help to find my old folders will be very gratefully received. I tried the same thing in THUNDERBIRD and it seems ok -I could see my folders at least . On Thu, 17 Dec 2009 07:38:02 -0800, DUNDALKSPUR wrote: > Hi- I have just bought a new WINDOWS 7 PC and transferred my OUTLOOK EXPRESS > (WINDOWS XP) ...

Wrong characters displays in the task window.
Everytime that I try to type something in the task windows the wrong characters appears. Also when updating information. Already check the language settins all the service packs are there. Windows XP and is Outlook 2002 What can I do!! ...

Integration with legacy systems
Hello there. 've seen there is an integration between Microsoft CRM and MS Great Plains. I need to do a similar integration beetween Microsoft CRM and a local System ERP named Diapason. The customer shoul be created by MS CRM. passed to the ERP. Updated tin the ERP and then updated automatically in the MS CRM. Order born in CRM. When approved, tehy should send to the ERP. The ERP create the invoice and send the invoice to MS CRM. Price list is managed by the ERP, imported in MS CRM and when updated in ERO, should be updated automatically in CRM. Customer are updated in ERP and shou...

Windows Live Call
Hi everybody, hello Jonathan, I would like to know if Windows Live Call will be available in Czech Republic or there is any possibility MS starts discussion with any local call provider? WLM isnt used so much as the ICQ in CZ, but I think WLM would be more popular if there would be this option, because ICQ supports only SMS messages and local call rates are high (except Skype). Thanks for answer and happy new year to all :) Greetings Petr, I really have no idea and to be honest, I probably won't be able to find out. However, if I do, I will update this threa...

Trust access to visual basic project in XP systems
we have 2000 OS in some system and XP in some system .Excel in XP system not have checkbox (Trust access to visual Basic Project) for macros . Because of the this i think vb exe which is try to run excel macro are failing. can any one hlep me. This is a setting that each user must change. So I think you'll have to educate the users to change this setting before your VB program can run. kasi wrote: > > we have 2000 OS in some system and XP in some system .Excel in XP system not > have checkbox (Trust access to visual Basic Project) for macros . > Because of the this i...

OL2000 vs OLXP-Small business version
I am trying to schedule meetings between these two versions. When I send a meeting request to the 'small business version' it receives the an email, but no request to accept,decline? Any suggestions, I have both workstations using rich-text format. ...

overriding the print button and File/Print
Hello: I have a model that I want to override the ability to print only one page. The model has 3 pages and the first page needs to be printed first always before any of the others. Can a macro be written that attaches to the model that only allows printing from a custom print macro? Or, something that when the user hits the toolbar print button (or File...Print...) the model always prints the first page too? Yes - use this Private Sub Workbook_BeforePrint(Cancel As Boolean) Cancel = True End Sub Put this in the module attached to this workbook in the VBE and it disables printing from th...

excel causing system to be in low system resource
Hi all. Whenever i open my excel application, i am always prompted low system resource and have to exit the application. However all my other office applications like word, access work fine when i open them. I face similar problems before and i reinstall excel to solve the problem. Is there a better solution which can solve this problem once and for all? Thks in advance ...

Outlook 2003 and Windows 7 problem
I justed added Outlook 2003 to my new computer which came with Windows 7 preinstalled. Everything seemed to be working ok until I tried to add apic to an email. I pressed the insert file button and hit the drop down looking for the libraries folder to get a pic. I'm finding that in outlook this folder is blank. I have plenty of pics in libraries so I know that is not the issue. Does anyone have any idea what is happening and a possible fix? Thnaks Brian Office 2003 uses its own file browser which is not aware of the Library structure which was introduced in Windows...

tabbing into and out of a web control
Hi folks, I have an MFC dialog that has 4 buttons on it and a web control. The web control loads an html file that has several ATL composite controls. I've got tabbing enabled for the ATL controls but I don't know how to setup tabbing between the web control and the buttons on the dialog. Anyone have suggestions or a solution? thanks Mike The solution is to modify the styles of the extra windows that the web control generates to have WS_EX_CONTROLPARENT. "Mike Frith" <mfrith@esri.com> wrote in message news:%23lzbDKFsDHA.3420@tk2msftngp13.phx.gbl... > Hi folks, ...

How do I Install Publisher2003 in windows ME? HELP!
I have Windows Millineum and I am trying to install publisher2003 with digital imaging for a much needed and overdue newsletter project. It will not install. It tells me that I need a newer version of Windows, but when I check on publisher's requirements, it reads windows 2000 or above so I believe it should install. If anyone can tell me what to do, I would appreciate it. Keep in mind that I know very little about computers, very, very, little. Thanks, Linda Carter Housecat02@hotmail.com It will never install on Windows Me. Read the box... Publisher 2003 will install on Wind...

Command Button code
Good evening all I am after some simple code to apply to a CommandButton1_Click(), where when the button is clicked, today's date is inserted into the active cell. (Though I do require this date to then be fixed, and not change the following day) Any help most appreciated. Thank you Mathew --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003 Mathew here is one way Selection = Date -- Paul B Always backup your data before trying something new Please post any response to...

Print button on ribbon not enabled
Weird button behavior on print preview ribbon in Access 2007. For some time now, I have noticed that occasionally, when we open a report in print preview mode, the print button on the print preview tab in the ribbon is dimmed and not enabled. This happens on all our computers, not just one. It happens about 25% of the time we open any report. The workaround has been to right click and use the built-in shortcut menus to print from the preview. I finally got around to writing my own ribbon xml and having the users open the application in runtime mode to lock things down a bit. When I...

can all the dowloads ihave in the system can they be moved
Iwant to take all downloads that have failed and all downloads that have errors with them Where would you like to take them? Buckingham Palace? "steve.vickers2010@live.co.uk" <steve.vickers2010@live.co.uk@discussions.microsoft.com> wrote in message news:208855E4-BD3F-4C3D-A817-C0DC8CB6BCF9@microsoft.com... : Iwant to take all downloads that have failed and all downloads that have : errors with them Windows version is...? If you want to delete what you see in Update History, I can tell you how to do that. steve.vickers2010@live.co.uk wrote: > I...

Removing Buttons
I copied buttons from a WEB page into an EXCEL spreadsheet. I tried to remove the buttons using edit/go to/special/objects -- but it says 'no objects found'. I also tried to 'right click' the button and cut - but it did not work either. I can send you a sample if possible. If there's no shapes you want to keep, maybe this'll do it for you. (Save your file first--just in case.) Option Explicit Sub testme() Dim iCtr As Long Dim myErrNumber As Long With ActiveSheet .Shapes.SelectAll On Error Resume Next Selection.Delete ...

Total Communications System & MS CRM 3.0
To Anyone: I am trying to find a complete "converged communications" system that has complete integration with MS CRM 3.0 as well as an open API that I can further integrate into my business applications. I am finding a lot of sales pitches but no hard facts and confirmed installs. Can anyone point me ? Anthony DeHart try www.genesyslabs.com ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "Anthony" <Anthony@discussions.microsoft.com> wrote in message news:D009397A-044A-482E-97F8-D2BADC9A6A15@microsoft.co...

How to custom draw in edit control non-client area
Hi, I have a requirement to change the look & feel of scrollbar in edit control (scroll button bitmaps, track bar area lines) I cannot use flat scrollbars. How do I draw in non-client area (ie scrollbar area) what event I have to handle WM_NCPAINT ? waiting for reply. Thanks & Regards, Raman. ...

sevice packs not included in windows update??
I am running windows vista home premium and have had to reinstall. When going through the windows update the service packs dont show up. do i need to download and install manualy? -- smills98823 Windows Vista and Windows Server 2008 service packs are not available for installation through Windows Update: http://support.microsoft.com/?kbid=948343#method5 smills98823 wrote: > I am running windows vista home premium and have had to reinstall. When > going through the windows update the service packs dont show up. do i > need to download and install manualy? >...

File system
Hi I am havimg some problem in booting WindowCE 4.2 . The bootup failed in filesystem 1. can anyone help me how to debug the error or where area in windowce I should zoom into for susch problem The ouput of error message is given below FMD::FMD_Init FMD_ReadSector() ######## BLOCK 10 FMD_ReadSector() ######## BLOCK 10 Data Abort: Thread=8feec5d0 Proc=8e028b58 'filesys.exe' AKY=ffffffff PC=8c233c78 RA=8c233c00 BVA=04000000 FSR=00000007 Data Abort: Thread=8feec5d0 Proc=8e028b58 'filesys.exe' AKY=ffffffff PC=8c2169d8 RA=8c216a38 BVA=04000019 FSR=00000003 D...

using access as a content management system for documents
Hello got a question for you all, I am using access to create a content management solution. initially it seems pretty easy i would create a table for each type of document template. and the fields in the table would be the different sections within the template. the data in the fields would be the content this goes with those specific sections in the document. basically i would have a report that puts all the fields together in the correct order and export that to a word document. here is my problem.. some of my data includes bullet points Bold letter and different colors.. is there anyw...

automatically emailing form created in Excel
I have created a template for entering time in Excel. Is there a way (other than file; send to recipient as attachment) to create a link that will automatically email the document to a pre-specified recipient? Am I working backwards? Should I create the form in Outlook? Thanks ...

Can't Open 2nd Window
I used to be able to click the "Launch Microsoft Outlook" icon on the left end of the taskbar to open up a second Outlook window, so I could have 2 mailboxes open at the same time. I could even do a search in one mailbox while working in the other window. Suddenly I can't do this. Clicking the "Launch Microsoft Outlook" icon just switches the current window to the inbox and does not open another window. My .pst file size is about 700K, considerably smaller than I used to keep it. I have run Repair Office from the installer. Any suggestions? Thanks. Right-cl...