Assuming you want textbox to be editable only when DropDown value is X...
Change the DisplayMode property of textbox to something as below (you will have to replace with your own control names):
If(DropDown1.Selected.Value in ["X","Y"],DisplayMode.Edit,DisplayMode.Disabled)
if the selected value in DropDown1 is "X" or "Y," the textbox will be in "Edit" mode, allowing users to edit the text. If the selected value is anything other than "X" or "Y," the textbox will be in "Disabled" mode, meaning users cannot edit its content.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.