Frage

I'm using the InputBox from the VB .dll. When I display it, I want to put it in a particular place relative to the controls it will have an impact on (out of their way). So I have this pseudocode for showing the InputBox ("selectionStart" is a Point assigned to on MouseDown):

int HeightOfInputBox = ? <- What is this value?
int XPos = selectionStart.X;
int YPos = selectionStart.Y - HeightOfInputBox; 
Interaction.InputBox("Prompt", "Title", "DefaultResponse", XPos, YPos);

My question is: What is the height of an InputBox?

War es hilfreich?

Lösung

You do not have access to the object to get the Height or Width information. The only properties available are what you set when you initialize it. If you need the Height you will need to roll your own. This CodeProject article is an example on how to, you could just add another intializer to set the Width and Height of the InputBox.

i.e. InputBox("Prompt", "Title", "DefaultResponse", XPos, YPos, Width, Height);

Andere Tipps

you can use Me.ActiveControl for the current control

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top