#include once "window9.bi"

Function ResizeGadget(ByVal gadget As integer, ByVal x As Integer,ByVal y As Integer,ByVal Width_ As Integer,ByVal Height_ As Integer) As Integer Export
  If x=FB_ignore Then x=GadgetX(gadget)
  If y=FB_ignore Then y=GadgetY(gadget)
  If Width_=FB_ignore Then Width_=GadgetWidth(gadget)
  If Height_=FB_ignore Then Height_= GadgetHeight(gadget)

  Function = MoveWindow(GadgetID(gadget),x,y,Width_,Height_,TRUE)
  
  If GetClassName_(GadgetID(gadget)) = WC_TABCONTROL Then
		Dim As RECT re
		SendMessage(GadgetID(gadget),TCM_GETITEMRECT,_
					Cast(WPARAM,GetProp(GadgetID(gadget),"paneltabItem")),Cast(LPARAM,@re))
		ResizeWindow(GetProp(GadgetID(gadget),"paneltab"),1,re.bottom+1,_
						GadgetWidth(gadget)-3,GadgetHeight(gadget)-26)  	
  EndIf  
End Function
