** END HEADER -- do not remove this line // // Generated on 2022-06-06 // parameter bModal local f f = new force_combox_dropForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class force_combox_dropForm of FORM with (this) onOpen = class::FORM_ONOPEN metric = 6 // Pixels height = 352.0 left = 514.0 top = 0.0 width = 280.0 text = "" endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) height = 22.0 left = 94.0 top = 81.0 width = 84.0 value = "Entryfield1" endwith this.COMBOBOX1 = new COMBOBOX(this) with (this.COMBOBOX1) height = 22.0 left = 94.0 top = 132.0 width = 84.0 dataSource = 'array {"a","b","c","d"}' style = 1 // DropDown dropDownHeight = 132.0 autoDrop = true endwith this.ENTRYFIELD2 = new ENTRYFIELD(this) with (this.ENTRYFIELD2) height = 22.0 left = 94.0 top = 183.0 width = 84.0 value = "Entryfield2" endwith this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 43.0 left = 85.0 top = 260.0 width = 107.0 text = "Set focus to combobox" endwith this.TEXT1 = new TEXT(this) with (this.TEXT1) height = 33.0 left = 11.0 top = 7.0 width = 241.0 text = "Form metric must be Pixels otherwise Windows can't place the cursor correctly." endwith function PUSHBUTTON1_onClick() form.combobox1.setfocus() // Not really neccessary. //The programmed click on the combobox button will set focus anyway. form.drop_list() return function drop_list //Place form coordinates that will show the cursor over the combobox button into form.point //This conversion to screen coordinates needs to be done each time the function is executed //in case the user has moved the form on the screen form.point.setx(form.combobox1.left+form.combobox1.width-10) //make sure cursor is in button form.point.sety(form.combobox1.top+10) //Convert point values to position on screen. clienttoscreen(form.hwnd,form.point) //Get x and y coordinates for drop button on combobox form.x_combo = form.point.getx(form.point,0) form.y_combo = form.point.gety(form.point,4) form.rmMouse.screenLeftClick(form.x_combo,form.y_combo ) return function form_onOpen() if type("ClientToScreen") # "FP" extern clogical ClientToScreen(chandle,cptr) user32 endif set procedure to :duflp:rmMouseEvents.cc form.rmMouse = new rmMouseevents(form) form.point = new point() // point is a structure to hold the cursor's x and y coordinates return endclass