- www.mql5.com
Thanks! This solved it indeed and it works now! Thanks again, appreciated!
Hi,
I do have a follow up question on this topic.
I would like to show a different image for the button after it has been pressed. (it should toggle between two images, to identify that the action for this button is active)
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { MyInterface.OnEvent(id,lparam,dparam,sparam); if(id==CHARTEVENT_OBJECT_CLICK && sparam=="ManagedOrders") { if(Dialog2.IsVisible()==true){ Dialog2.Hide(); ButtonActiveOrders.BmpOnName("\\Image\\NotSelected.bmp"); }else{ Dialog2.Show(); ButtonActiveOrders.BmpOffName("\\Image\\Selected.bmp"); } //+------------------------------------------------------------------+ // chart event reset button state //+------------------------------------------------------------------+ ObjectSetInteger(0,sparam,OBJPROP_STATE,0); Sleep(100); ChartRedraw(); //+------------------------------------------------------------------+ } }
It loads the button well, and if I press the button the other image will appear (Selected.bmp). However, it will not change back to NotSelected.bmp if I click on the button again. If I press the mouse button, and hold the mouse button, I see the NotSelected.bmp. However, as soon as I release the mouse button I get the Selected.bmp.
What do I need to do to make the Image switch between Selected.bmp and NotSelected.bmp in order to show that the Dialog is active?
Artyom Trishkin has written a series of articles about graphical interface - keyword WinForms: https://www.mql5.com/en/users/artmedia70/publications
Take his solution and look how he manages buttons that are changing when the mouse hovers is over the button: https://www.mql5.com/en/articles/11356
Artyom Trishkin has written a series of articles about graphical interface - keyword WinForms: https://www.mql5.com/en/users/artmedia70/publications
Take his solution and look how he manages buttons that are changing when the mouse hovers is over the button: https://www.mql5.com/en/articles/11356
Thanks again! I will look into this tonight.
as my question was a new question, and I got no responses, I created the new one.
You didn't create a new one, you repeated the same question!
Have you any idea how annoying it is to spend valuable time answering someone's question only to find that when you open another topic, you find the same question and it has already been answered?
The time spent answering the question was time wasted.
Double posting is inconsiderate and selfish.
You didn't create a new one, you repeated the same question!
Have you any idea how annoying it is to spend valuable time answering someone's question only to find that when you open another topic, you find the same question and it has already been answered?
The time spent answering the question was time wasted.
Double posting is inconsiderate and selfish.
Well, then we both see it different. I see a question about a picture not showing on the chart, or how to handle the click event to change the picture as two different questions. For that reason, I reased a new topic as I wasnt sure if anyone was looking into my question as it was different (and I didnt got any responses yet). It was not done out of a selfish action, just because I found it different questions and I got no responses (which is very uncommon on this forum).
Artyom Trishkin has written a series of articles about graphical interface - keyword WinForms: https://www.mql5.com/en/users/artmedia70/publications
Take his solution and look how he manages buttons that are changing when the mouse hovers is over the button: https://www.mql5.com/en/articles/11356
I appreciate your support, but I can't find what I do wrong. Any ideas?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I'm not sure what I do wrong, and hope anyone can help me with this one.
I try to add a bmp button to a dialog/panel, but the bmp image isnt shown. I do see the button in the objects list on the Chart, but the image itself is not shown.
This is the code:
Anyone know what to do to make it work?
Thanks in advance!
Kind regards,
Victor