In WinForms and C#, it seems I cannot create a control wider than 65535. If I set it to 70.000, the value gets reset to 65535.
Digging through the source of Control.Size with ILSpy, I couldn't immediately find the code responsible for clamping the size.
So is this a limit of the Win32 API or of Windows Forms? Is there any way around this, e.g. with unmanaged interop?
The reason I need such a large control is that I draw music waveform of very long audio files onto it. (Yes, I could draw the waveform directly, without a containing control; but that would require lots of refactoring). I am not talking about the drawing code here. Clearly it's necessary to draw only the visible part, but the thing is that I'd like to have a control as wide as 200.000 pixels.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…