C# - Add winform or WPF

I have some task dialogs that pop-up when I click a button in Revit… I want to change them into either WPF or winforms but can’t seem to get it to work. Even simple stuff like, “Hello world”…

Are there any step-by-step guides for these anywhere?

WPF: I can only find “user control” is this the correct thing to add?

Winform : This one seemed to get further and it ran but nothing happened in Revit.

Hi!

this guy has some amazing tutorials about creating WPF UI to support Revit addins:

I’m not sure if this is what you are asking for. I’d suggest using WPF over winforms in the case for Revit

2 Likes

Awesome. Thank you.

Why do you suggest WPF instead of winform?

This video… he has a starwars tab. I love it already :smiley:

1 Like

It’s much more flexible and offers a bit more up to date approach as it uses xaml. Once you get used to it, it, it’s much easier to work with. it’s also more or less the standard for creating UI’s for Revit plug ins :slight_smile:

1 Like

Thanks :slight_smile:

I’ve been using winforms in Dynamo for the last couple of years… kinda kicking myself I’ve got to learn yet another thing (on top of trying to learn C#) … Ah well, good for the brain I suppose.

If only I could remember to put the bins out on the right day… :stuck_out_tongue:

to be honest, I’ve only used WPF in order to create UI for C# plug ins. For Dynamo, I’ve only used Data-Shapes. It works fine for me so far. About learning - yeah… seems it will never end :smiley:

1 Like

Build a Dynamo view extension for that. :stuck_out_tongue:

I recommend starting with C#, then do some zero touch tutorials, a zero touch example, a view extension tutorial, and a view extension example. Then get into UI.

2 Likes

Hi @Alien,

There are a lot of example on this forum:
Revit API Forum - Autodesk Community

I think there is in that forum more knowledge of C# :slight_smile:

1 Like

Yay, thank you :slight_smile:

I wish that forum looked more like this one though… I find this forum much easier to navigate.

I use Visual Studio to create winforms. You can draw the UI in the designer and the code is created for you. It’s really easy and good for beginning.

I think you can create awesome ui’s with winform, here’s one of my recent ones.

I recommend this awesome youtube channel, there are many UIs created with explainations and you can find all the code on the homepage!

No experience with wpf/xaml yet

7 Likes

Yep haha,
WPF is more stable, I suggest to use wpf.

1 Like

I have a sample using wpf in a zero touch node here:

3 Likes

Haha I like the resources :rofl:

1 Like

Winform is old and terrible. I would definitely suggest you to go with WPF…

Thanks all!

I’ve been snowed under with other stuff but am definitely going to give WPF another go…

Watch this space for complaints :stuck_out_tongue:

2 Likes