why is UButton "SetVisibility" member function not inherited from parent class (UWidget)

Recently I was trying to hide a UButton from my C++ class but I wasnt able to find the SetVisibility function.
According to UButton | Unreal Engine Documentation UButton has a parent “UWidget” which has the member function “SetVisibility” and is also declared in public section as well.

I am wondering why is it not accessible via the descendent class of the UWidget?

Hello @Levi_37 ,

Can you show the code? because Setvisibility in button should work fine since I also do that and it’s work fine.