NexusFi: Find Your Edge


Home Menu

 





How can i set the Content of a Button as an Image


Discussion in NinjaTrader

Updated
    1. trending_up 1,497 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 
WoodyFox's Avatar
 WoodyFox 
Columbus, Ohio
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Futures
Posts: 417 since May 2016
Thanks Given: 206
Thanks Received: 891

I have this Drawing indicator that alligator posted to the Ninjatrader Forum and would like to change the NT Icons he used to .jpg images that were used in Sim22 Drawing tool. This would help make them stand out.

if (!isToolBarButtonAdded && showRuler)
{
btnRuler = new System.Windows.Controls.Button { Content = NinjaTrader.Gui.Tools.Icons.DrawRuler, };
btnRuler.Click += btnRuler_Click;
chartWindow.MainMenu.Add(btnRuler);
}
would it be possible to change the Content somehow to
Uri(Ninjatrader.Core.Globals.UserDataDir + @"bin\Custom\ToolBarIcons\Ruler.jpg"))

I only know basics of programming and any Help would be appreciated.
The whole .cs File is attached.
Thanks Woody


Attached Files
Elite Membership required to download: _DrawingTool.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Fired a Missile at Israel Last Night. The $8M June …
Prediction Markets & Event Contracts
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
Thanks Mike. Godspeed.
The Elite Circle
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,947 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,855


Try something like this :

 
Code
btnRuler.BackgroundImage = Image.FromFile(Ninjatrader.Core.Globals.UserDataDir + @"bin\Custom\ToolBarIcons\Ruler.jpg"");


Follow me on X Visit my NexusFi Trade Journal Reply With Quote




Last Updated on April 16, 2017


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts