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 954 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread

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

  #1 (permalink)
 
WoodyFox's Avatar
 WoodyFox 
Columbus, Ohio
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Futures
Posts: 409 since May 2016
Thanks Given: 196
Thanks Received: 876

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?
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Quantum physics & Trading dynamics
The Elite Circle
 
  #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: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Try something like this :

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

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




Last Updated on April 16, 2017


© 2024 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 - Privacy Policy - Downloads - Top
no new posts