How to create a record button?

How to create a dontnet button to display one image when pressed once, and another - when pressed second time(for example red and grey)

		--btn = dotnetobject "Button"
                dotnetcontrol btn "System.Windows.Forms.Button" pos:[667,101] width:15 height:15 border:false
		--btn.FlatStyle = btn.FlatStyle.Flat
                btn.flatstyle = dotnetobject "System.Windows.Forms.FlatStyle" Flat
 
                btn.Location = dotNetObject "System.Drawing.Point" 1 prevh
               i=1
             if i==1 then
             (
                btn.image = (StringToImage record_red)
                i=0
             ) 
             else 
                btn.image = (StringToImage record_grey)

just to use that if, or there is a more correct way?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
yuanmake1's picture

A growing number of musicians

A growing number of musicians are making their music available for licensing on royalty free music websites like MusicRevolution.com.

Yuan John

artrender.info's picture

aah

ok! Thx Barigazy! You answered to my questions! I guess you'll have a headache because of me!

barigazy's picture

No I just try to replicate

No I just try to replicate free iToo Clone modifier with mxs modifier but I go to the dead end. It's not posible, only C++ can be solution. You already have same problem in another post:)

barigazy

artrender.info's picture

oh, yeesss

It's working great now! By the way, does this kind of menu support separators?

Is it possible with it to create smth like that?

http://www.scriptspot.com/files/rcmenu.jpg

barigazy's picture

Yup. But you can't paint in

Yup. But you can't paint in dark gray separator. Not works.
Take look of properties of context menu. I used Proffesional mode and remove left part (where you add F1)

barigazy

artrender.info's picture

Answer!

About record button! It works great, THX, just didn't have time to convert it to work as btn.image, because I have image to display instead of text! By the way, does btn "CheckBox" support image?

Now about context menu! It shows just a shadow when pressing rightclick on record button-I mean about second script. See the attached image!

I appreciate very much your help, barigazy!!!! You're brave!

AttachmentSize
context_menu.jpg 38.53 KB
barigazy's picture

...

.net checkbox support images.
ContextMenu works fine I tested in max2012x64 and 2014x64

barigazy

barigazy's picture

...

Disable transparency ei. put "--" (as comment) or delete this line

--maybe this cause problem
dnCM.Opacity  = 0.85d0
 

barigazy

artrender.info's picture

oh, thx Barigazy

I will try your code and I will let you know later! Thx again! Srry that I give so many questions!

artrender.info's picture

on no

in my case it will be always red :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.