tedit change background color

hi all,
i am trying to migrate a couple of  application from xe2 to xe3 and i have this problem :

   r := ((codice_ricetta as tedit ).FindStyleResource('background') as TRectangle);
   if Assigned(r) then
     begin
       r.Fill.Color := TAlphaColorRec.Lime;
     end;

this code is working on xe2 but i receive this error on xe3 :

First chance exception at $751E277C. Exception class EInvalidCast with message 'Invalid class typecast'. Process Superv.exe (5916)

the background color do not change anymore.

there is a new metod on xe3 to do that?

thanks in advance

G.Magistro
0
giuseppe
2/22/2013 8:56:26 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

2 Replies
2787 Views

Similar Articles

[PageSpeed] 16

> i am trying to migrate a couple of  application from xe2 to xe3 and i have this problem :
> 
>    r := ((codice_ricetta as tedit ).FindStyleResource('background') as TRectangle);

This assumes the 'backgound' style element is a TRectangle object. While this happened to be so for all the default styles in XE2, in XE3, it is a TSubImage for the 'platform' styles.

> there is a new metod on xe3 to do that?

No. Your best bet I think is to put the memo on a TRectangle of your choice, and make the memo background transparent -

((codice_ricetta as tedit ).FindStyleResource('background') as TControl).Opacity := 0;

This will then work regardless of whether the 'background' element is TRectangle or a TSubImage.
0
Chris
2/22/2013 10:23:31 PM
Hi Chris,

i solved in very simple way , starting from your Idea.

i need 3 color to show over the default one (red,yellow and green) , so the opacity method is not enough for my purpose.

i created 3   .png images with paint in 5 minutes.  (red,yellow and green matte images of course .... )  

i created the default  tedit styles configuration , and 3 more custom styles for tedit, each style in the source propertie load a timage associated to the 3 files.
 
the code now is very simple :)   :

     (codice_ricetta as tedit ).StyleLookup :=  'edit_lime_style';

     (codice_ricetta as tedit ).StyleLookup :=  'edit_red_style';

     (codice_ricetta as tedit ).StyleLookup :=  'edit_yellow_style';

the good of this is the freedom to load any kind of background image to the tedit object .

for next project i can reuse the style saved to external file.

Thank You 

G.Magistro
0
giuseppe
2/23/2013 3:53:53 PM
Reply:

Similar Artilces:

How to change color of Text background in TEdit for iOS
I would like to be able to have TEdit's background change when it has the focus. A solution posted on the net seems to indicate that we grab the background style and change the fill color. But, this doesn't work and I suspect it's for FM2 and not not FM3. *Q. What's the secret to changing the background color of a TEdit on iOS in FM3?* > {quote:title=Charles Stack wrote:}{quote} > I would like to be able to have TEdit's background change when it has the focus. > > A solution posted on the net seems to indicate that we grab the background style and ...

Datawindow status changed after background color changed
I have a problem on the datawindow After I changed the background color and tab order of a column, in debug mode, I find the column by using gettext and getitemstring to get the data after retrieved. I can get the current row number and current column name, however, using gettext() is returned empty string, but using GetItemString() is return the actual data of this column. why the reason is different? Gettext() returns the value that is in the edit control that "floats" over datawindow columns (as the user tabs along). Thus, gettext() returns a value that may have...

Grid View Footer background Color based on either RowStyle background Color or or AlternatingRowStyle background Color
Hi Friends, As of my requirement,I have a grid view .Now the background color of the Footer of Grid view ,will have to be dynamic,i mean it will depend upon Row Style background color and AlternatingRowStyle background Color i.e, if the row above footer have row style ,then footer will have alternative row style background color and if the row above footer have alternative row style ,then footer will have row style background color. How can it be done. Regards, Ritesh This VB code in your GridView RowDataBound event may work for you: If e.Row.RowType = DataControlRo...

Change BackGround Color
Hi, I am writing a program that changes the background color from the user's input.  The user will enter the color in a text box.  I dont know how to accept the user's input and change the background color.  The code that I have written is listed below.    Thanks in advance for your help. 1 <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtm...

Changing Background color
Hey there , Just a quick question.Is there an easier way to programtically change the background color of a datawindow singleline edit control? What i've done so far is to code the itemfocuschanged event and use an IF THEN ELSE such as follows IF dwo.name="<fieldname>" THEN this.object.<fieldname>.background.Color=RGB(255,255....) ELSE this.object.<fieldname>.background.Color=RGB(255,255.....) END IF This works,however for forms with over 10 fields it can be tedious. When you say "Datawindow single line edit"...

Changing Background Color
Hello, Using the following syntax: dw_1.Modify("ls_columnname.Background.Color='65535'") does not work to change the background color through PowerScript. We have tried to use the technique on the datawindow, which works but that method will not be feasible for what we are trying to accomplish. We are trying to implement this today for a product DEMO. Any suggestions... Try it this way: dw_1.Modify(ls_columnname + ".Background.Color='65535'") Unless ls_columnname is the name of the column. Brad lfenceroy wrote: > Hello, >...

Changing background colors
I have a cloumn that changes color based on the value of the column. Is it possible to get the windows default background color to set the color of the column, or do I have to hope that everyone always uses white? You can read the windows default background color from the background color of any object that has the background set to Window Background(like the window or any other controls on it). If you do not have any, just add a dummy text onto the dw and read its background color. -- SRLoka "Rich Vita" <LuvMe747@aol.com> wrote in message news:3OQs1MQ7AHA.194...

How to change the Background Color?
Hi. I am new to DotNetNuke 3.X and I have a simple question. I am using one of the included Green Skins. I wonder how I can make the background to be white. I still want to maintain the menu to be green but I want the background (the area where the modules are display) to be green. I know that I should read the Skin documentation but given that I am looking for a very small change I thought that maybe you can give me a jump start. Change background-color in .skinmaster (skin.css).You can even add your own background colors to each content pane (.toppane, .leftpane...)DNN skins ForumTressl...

Change background color
Hi please have a look at the two line of javascript code, the first one works fine, why will the second line not change the background color to Brown?get('<%=Textbox1.ClientID %>').value="new text value"; $get('<%=Textbox1.ClientID %>').BackColor="Brown"; hope someone can clear this one up since i would like to use javascript and not Ajax to change cliet side prams. liam   Liam Mcmullen There is no Javascript attribute called BackColor on a textbox. To set the back color in Javascript, you need to go through the style at...

Change Background Color
Hello,How can I change the background color of an Asp:Panel when the mouse is over it?Thanks,Miguel There is no event hander to support for changing a asp:Panel backcolor when the mouse hovers over it.If you want to do so,you need to resort to the third party Panel control. ...

BackGround color change
hello.. may i know how do i change the color of my background juz using the submit color. eg. when my present pg is white den when i click the button that says "yellow" the whole background will change to yellow. when i click the button that says red den will chnage to red. hello u can do this: <body runat="server" id="Body"> and in the server side method of the submit button u can do something like that Body.Attributes.Add("BgColor", "yellow"); Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP but w...

Background color change
I want to change the background color on the default page, I used the stylesheet editor and set a background color. It does not take effect. What am I missing or doing wrong?...

How to change the background color
I am trying change the backcolor from white to blue. I changed the body section in the default.css file of white theme and I get the change color correctly on the design section in web developer but when I debug the website I get the same default background color which is white.. and not the changed color ? Can you any one tell  me is there any place that I need change the background color? there are a couple of useful tools that you can use to edit css within the browser and see your results as you go. Internet Explorer Development Toolbar and FireBug Addon for Firefox&nbs...

Change Background color
Hello to everyone: Is possible to change background color (by code) of a 'cell' in a tabular datawindow. When user changes a data in a register, i would like to change background color of the register. I've tested with: dw itemchanged: object.usuario_1[row].Background.PROPERTY = RGB(255, 0, 128) but doesn�t works. Any idea. Many thanks. Natalia To change properties on a row-by-row basis, you need to set the column's background.color property as an expression. Something like if ( object_list_object_name = object_list_object_name.original, rgb...

Web resources about - tedit change background color - embarcadero.delphi.firemonkey

Discovery of cosmic microwave background radiation - Wikipedia, the free encyclopedia
The accidental discovery of cosmic microwave background radiation is a major development in modern physical cosmology . Although predicted by ...

Android App OStream Speeds Up Facebook Experience By Synchronizing Content In Background
Facebook’s newly revamped Android application was rebuilt with a focus on speed, and startup oStream wants to help users of devices on that operating ...

Background for Dick Armey’s Endorsement of “Nothing for the Nation”
To truly grasp the profound nature of Dick Armey’s endorsement of Nothing for the Nation: Who Got What Out of Iraq, one must understand the events ...

Facebook Photos Gets Polish: White Background, Bigger Images That Load Faster
... Facebook product manager Justin Shaffer describes a new version of Facebook’s photo viewer coming out now. In place of the black lightbox background ...

Easy Background Tasks in ASP.NET
As I work on the badge implementation for Stack Overflow, I needed a way to call the code that detects and awards the badges out of band. Traditionally ...

Camera Amazing with Pictures Background Remover for iPhone 3GS, iPhone 4, iPhone 4S, iPhone 5, iPod touch ...
Get Camera Amazing with Pictures Background Remover on the App Store. See screenshots and ratings, and read customer reviews.

Obama tightening online loophole for gun sales, requiring background checks
... and Explosives to require those selling guns, whether at a flea market or online, to register as a firearms dealer and to perform background ...

THE WORLD’S GREATEST GUN SALESMAN: Nearly 25 million background checks in 2015 alone
... 100 million firearms have been sold during the Obama presidency . Now, ia Gun Free Zone we get the latest data dump on federal firearm background ...

Obama moves to close loopholes for gun background checks
The administration on Monday announced a series of executive actions they'll implement to reduce gun violence

Maggie Gyllenhaal in Marc Jacobs at the Globes: blending into the background?
... Her look did come in handy, I suppose, if she didn’t feel like being sociable at the HBO after party, as she seemingly blended into the background. ...

Resources last updated: 1/21/2016 8:51:22 PM