We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to retreive the BackColor in ARGB format

Thread ID:

Created:

Updated:

Platform:

Replies:

79351 Feb 3,2009 01:32 PM UTC Dec 19,2011 08:12 AM UTC Windows Forms 7
loading
Tags: Test Studio
Administrator [Syncfusion]
Asked On February 3, 2009 01:32 PM UTC

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 C [Syncfusion]
Replied On February 13, 2009 11:55 AM UTC

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


Administrator [Syncfusion]
Replied On February 16, 2009 08:19 AM UTC

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 Raja [Syncfusion]
Replied On February 19, 2009 03:37 PM UTC

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



Administrator [Syncfusion]
Replied On February 20, 2009 03:15 PM UTC

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 Raja [Syncfusion]
Replied On February 26, 2009 01:45 AM UTC

Hi Soloman,

Sorry for the inconvenience.

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

Regards,
Nirmal


Administrator [Syncfusion]
Replied On February 27, 2009 09:17 AM UTC

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
Replied On December 19, 2011 08:12 AM UTC

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.




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;