-3

I am using Microsoft Visual Studio Professional 2022. I'm creating forms programmatically adding content based on a JSON configuration, I need to set the size of the controls according to the configuration and this isn't working. In the debugger I can see the Height of a ListBox is 20, if I try to set the Height to 200 no error or exception occurs but the new value is not assigned.

I have added OnSizeChanged and added it to each control, I'm not sure what this is supposed to show me.

Can anyone help?

2
  • 1
    You should really post the code you're using for this task, also making clear in what context that code is run -- You don't add OnSizeChanged to a standard Control, you override that method in a Custom Control. Irrelevant here -- Are you sure you're not referring to, e.g., a TextBox instead? Commented yesterday
  • 1
    When height is reverted, OnSizeChanged will be invoked, so you can know who changes the height from the callstack. Commented yesterday

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.