Essential Test Studio Windows Forms
How to retreive the BackColor in ARGB format
December 19, 2011 03:12 AM by vidhya
Soloman
How to retreive the BackColor in ARGB format
February 3, 2009 08:32 AM
The following statement returns Color [Control]. How do I get the actual color from it?
SwfWindow("Hedge Fund Collateral").SwfObject("m_dealSimpleGrid").Object.CurrentCell.Renderer.StyleInfo.BackColor

Thanks & Regards,
Soloman

Rajadurai
[Syncfusion]
How to retreive the BackColor in ARGB format
February 13, 2009 06:55 AM
Hi Soloman,

Thanks for your interest in Syncfusion products.

Sorry for the long delay in responding to you.

Please refer to the following code that retrieves the color in ARGB format from the color object.

Color c = this.gridControl1.CurrentCell.Renderer.StyleInfo.BackColor;
int a = (int)c.A;
int r = (int)c.R;
int g = (int)c.G;
int b = (int)c.B;
Console.WriteLine(a.ToString ()+","+r.ToString()+","+g.ToString ()+","+b.ToString ());


Regards,
Rajadurai

Soloman
How to retreive the BackColor in ARGB format
February 16, 2009 03:19 AM
Hi Rajadurai,
Thanks for your response.I guess, my request was not in detail enough. My requirement is to get the cell background color of SF Grid. I am using QTP 9.2 with Sync fusion Test add-in (Syncfusion Essential TestStudio -6.2.0.40). I believe, I won't be able to use the code you provided, in QTP. Let me know, my requirement can be accomplished in any way.
Thanks & Regards,
Soloman

Nirmal
[Syncfusion]
How to retreive the BackColor in ARGB format
February 19, 2009 10:37 AM
Hi Soloman,

I have added a method called GetCellBackColor in the source of GridControl custom assembly.
Please download from the following location and replace it in the bin folder in your installed location of EssentialTestStudio:
GridControl.zip

And then try using the below code to retrieve the back color of a particular cell:
SwfWindow("GridControl").SwfObject("gridControl1").GetCellBackColor 11,6

Let me know if you have any queries.

Regards,
Nirmal


Soloman
How to retreive the BackColor in ARGB format
February 20, 2009 10:15 AM
Hi Nirmal..
I am not able to retrieve the attachement..Is there any issue with this attachment. Could you please check it out?
Thanks & Regards,
Soloman

Nirmal
[Syncfusion]
How to retreive the BackColor in ARGB format
February 25, 2009 08:45 PM
Hi Soloman,

Sorry for the inconvenience.

Please try the below link, and let me know if it helps:
GridControl.zip

Regards,
Nirmal

Soloman
How to retreive the BackColor in ARGB format
February 27, 2009 04:17 AM
Hi Nirmal,
Thank you for your response. I was able to download the DLL and I replaced Grid.dll in my machine with this file. When I executed the below scripts, I still get the "Color[Control]" as the background color.
If I don't set the cell first, I get "Color[Window]"

SwfWindow("Hedge Fund Collateral").SwfObject("m_dealSimpleGrid").SetCurrentCell 4,0
ret= SwfWindow("Hedge Fund Collateral").SwfObject("m_dealSimpleGrid").GetCellBackColor (4,0)
msgbox ret

Thanks in advance
Soloman


vidhya
How to retreive the BackColor in ARGB format
December 19, 2011 03:12 AM
Hi,

I downloaded the new dll and tried to fetch the Cell fore color using GetCellForeColor method. But it did not work. Please help.

Below is the statement used-
Color = SwfWindow("WindowName").SwfObject("ObjectName").GetCellForeColor(1,1)

Thanks in advance.



::adCenter::