hi i want modify this code when i push shift and click must do something , i use this combo because if i use only left click mouse , appear also when push over the button , i just did do a modify but not work anyone can helpme ? thanks
this will work first time, each subsequent call to ObjectCreate will fail with an error.
further commands - setting coordinates and size will be executed on every tick
you should create a button in OnInit() and remove it in OnDeinit() event
alternatively you could check on every tick if button still exists and recreate it if the user deletes it from the chart, but I wouldn't bother.
check this page and search for the ObjectCreate() section - you will find a code sample that creates label in the OnInit and removes it in the OnDeinit
Next problem is in the OnChartEvent() function
you use global variable "state" that never gets value
since the "state" variable is global, it is initialized to zero (0) and it will never be equal 4, so your code will never execute
if you copied this snippet from somewhere, please check that example again and find out how to set value of the "state" variable
hi i want modify this code when i push shift and click must do something , i use this combo because if i use only left click mouse , appear also when push over the button , i just did do a modify but not work anyone can helpme ? thanks
Your code has many problems.
Next problem is in the OnChartEvent() function