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,411 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: 205
Thanks Received: 890

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?
Zytrade: Devin Brady, CEO - Ask Me Anything (AMA)
Brokers
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
Bond Market Rout -- Worst Week Since Russias 2022 Invasi …
Treasury Notes and Bonds
CME Launches Bitcoin Volatility Futures June 1 -- First …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 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,860


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