# Create widget in c++

**URL:** <https://forums.unrealengine.com/t/create-widget-in-c/634870>\
**Category:** UI\
**Tags:** unreal-engine, UE5-0, Widget, question, CPP\
**Created:** [August 26, 2022, 3:34pm UTC](https://forums.unrealengine.com/t/create-widget-in-c/634870 "2022-08-26T15:34:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ZenLeviathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zenleviathan/32/551307_2.png) [@ZenLeviathan](https://forums.unrealengine.com/u/ZenLeviathan)\
**Post date:** [August 26, 2022, 4:06pm UTC](https://forums.unrealengine.com/t/create-widget-in-c/634870/2 "2022-08-26T16:06:51Z")

</div>

Hey @Kryst-ian, welcome to the forums!  
The only issue I can see is your auto typing - it itself is not a type, but a placeholder for one. I cannot be used in certain casts or operators, so my only recommendation is to possibly have your button typed as a UButton. You may have this already since I can’t see your header file, but this is the only problem I can see within your code.  
I also found a question from a while back whose answer might show you something to spark your thoughts: [Create widget in pure C++ - #2 by Shohei](https://forums.unrealengine.com/t/create-widget-in-pure-c/367306/2)  
I hope this can help!  
-Zen

---

_[View the full topic](https://forums.unrealengine.com/t/create-widget-in-c/634870)._
