Help !

on a onclickbutton i've write this code :

Label1.caption := 'close the door';
function to check if door is closed enter here !!
if door.enabled = false then
room := inputbox('Room Number','Number',0);

here's the problem why that just when the inputbox apears the label1 get

Does exist some kind of Inkey() for windows ? I know this sounds strange
but i really need the label updated befores the inputbox, because if the
function returns true doesn't apear even the label.