Modify the value of wpf control by maxscrips


#1

Hello everyone
I am making a tool now i am a wpf newbie i am having a little difficulty now
I created a user interface with wpf but I can’t control him

dllpath = @“G:\TEST\bin\Debug\TEST.dll”
Load_dll = (dotnetClass “System.Reflection.Assembly”).Load((dotnetClass “System.Io.File”).ReadAllBytes(dllpath))
show_dll = Load_dll.CreateInstance(“TEST.Window1”)

show_dll.MAX_Window()

I have a progress bar in my Dll. How do I set his value with the mxs command

The following wpf content:
"


</Grid>
" I thought of using

show_dll.Progress_Test.value = 90

but it doesn’t work


#2

You should assign a name for the control and then use “show_dll.FindName” to retrieve it.


#3

You need find the object by path , example:
the out grid is show_dll.Content
if the progress bar is the first object of out grid , use show_dll…Content.Children.item[0]
you can define a global variable as an object with a long path.


#4

Thanks for help, I have tried to assign him the name “Progress_Test” before. When I use the command show_dll.Progress_Test.value = 90 or show show_dll.Progress_Test he has an error prompt. Unknown property


#5

Thanks for your help. Your method solved my problem. The background has been reviewing so I ca n’t reply before. Thank you.