Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, July 5, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Changing font color in Currency and Number controls
duen muchenje
Posts: 4
 
Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 2:09 PM
Hi guys, I'm a newbie to slx web development and I have an issue that I hope somebody can help me resolve. I have a few currency and number controls on a form that I would like to change the font for the number contained in the control depending on whether the number is positive or negative. The issue I am having is that when I access the controls properties I do not see the ForeColor property such as when you are using a textbox. I have been working with an example that I got from someone, but that does not seem to work very well. An example of the code is below:

System.Web.UI.WebControls.TextBox txtNumClosedLostQty = (System.Web.UI.WebControls.TextBox)form.numClosedLostQty.NativeControl;
txtNumClosedLostQty.ForeColor = System.Drawing.Color.Red;

I thought this would work since I was under the assumption that TextBox was the base object for these other controls such as the number control but when I try to cast that number control back to a Textbox the app pukes. Any ideas for solving this would be greatly appreciated. Thank you.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 2:29 PM
The Currency control is not a Derived control, but rather a Composite control. Instead of trying to cast it, you need use FindControl to get the actual TextBox.

Something along the lines of:

//This code is for illustration purposes, I have not tried this myself.
TextBox theControl = form.numClosedLostQty.FindControl("CurrencyTextBox"); //I am not 100% on the Child control's name
theControl.ForeColor = System.Drawing.Color.Red;







[Reply][Quote]
duen muchenje
Posts: 4
 
Re: Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 2:46 PM
Thanks for the help Raul. I have tried the example you provided for me here. However my controls do not seem to expose that FindControl method so my app won't build as it says that FindControl does not exist. I doesn't even show up on intelliscence.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 2:52 PM
I would suggest you try this on Visual Studio, not on SLX App Architect.
Also, for debugging purposes it is always best to deploy without compilation so that you could test on Visual Studio.

I seldom make any Coding changes on SLX Via the App Architect !!
[Reply][Quote]
duen muchenje
Posts: 4
 
Re: Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 2:58 PM
Yes, I am working from in Visual Studio. We found out the hard way that Visual Studio and not App Architect was better environment to develop in. So I am developing in Visual Strudio and when I hit my control, FindControl is not one of the methods that show up on intellisence. I went ahead and build my project anyways just in case and ofcourse it puked . But I really appreciate taking your time trying to help out. Hopefully I can resolve, been working at it for a few days now.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 3:34 PM
Try this:

Put in a break point on any event of the Page (OnLoad, PreRender), then add the control name to the Watch window and Manually explore its Controls property. Once you find the actual Text Box you should then be able to get a Find Control statement that works for you.
[Reply][Quote]
duen muchenje
Posts: 4
 
Re: Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jul 09 8:50 AM
Raul, sorry for getting back with you so late. I was finally able to manipulate the font color in the currency fields as I needed and I appreciate all your help.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Changing font color in Currency and Number controlsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jul 09 8:55 AM
No need to apologize. However, I am glad to hear you were succesful.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/5/2025 4:01:32 PM