I am afraid combo box control's on change event is not fired when the value is changed through the code. I had linked three combo boxes in the following example. Initial value is changed using 'main.combo_1.value := 1' after adding some items. But on change event is not fired at all.Roberto Lopez wrote:Please, if you find a control that not work so, report the problem.rathinagiri wrote:So, I need not do so, in future. That's nice. Thank you Roberto.
Regards,
Roberto.
This is main.prg
Code: Select all
#include <minigui.ch>
Function Main
Load Window Main
main.combo_1.deleteallitems()
main.combo_1.additem("One")
main.combo_1.additem("Two")
main.combo_1.additem("Three")
main.combo_1.value := 1
Main.Center
Main.Activate
Return
function combo1changed
main.combo_2.deleteallitems()
if main.combo_1.value > 0
for i := 1 to 5
main.combo_2.additem(main.combo_1.item(main.combo_1.value)+str(i))
next i
main.combo_2.value := 1
endif
return nil
function combo2changed
main.combo_3.deleteallitems()
if main.combo_2.value > 0
for i := 1 to 3
main.combo_3.additem(main.combo_2.item(main.combo_2.value)+str(i))
next i
main.combo_3.value := 1
endif
return nil
function combo3changed
msginfo("Here")
return nil
Code: Select all
* Harbour MiniGUI IDE Two-Way Form Designer Generated Code
* (c)2004-2008 Roberto Lopez <harbourminigui@gmail.com>
* http://harbourminigui.googlepages.com
DEFINE WINDOW TEMPLATE AT 131 , 232 WIDTH 550 HEIGHT 350 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL MAIN CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR Nil NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE COMBOBOX Combo_1
ROW 80
COL 150
WIDTH 100
HEIGHT 100
ITEMS {""}
VALUE 0
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE combo1changed()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
SORT .F.
ONENTER Nil
ONDISPLAYCHANGE Nil
DISPLAYEDIT .F.
IMAGE Nil
DROPPEDWIDTH Nil
ONDROPDOWN Nil
ONCLOSEUP Nil
END COMBOBOX
DEFINE COMBOBOX Combo_2
ROW 80
COL 270
WIDTH 100
HEIGHT 100
ITEMS {""}
VALUE 0
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE combo2changed()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
SORT .F.
ONENTER Nil
ONDISPLAYCHANGE Nil
DISPLAYEDIT .F.
IMAGE Nil
DROPPEDWIDTH Nil
ONDROPDOWN Nil
ONCLOSEUP Nil
END COMBOBOX
DEFINE COMBOBOX Combo_3
ROW 80
COL 390
WIDTH 100
HEIGHT 100
ITEMS {""}
VALUE 0
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE combo3changed()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
SORT .F.
ONENTER Nil
ONDISPLAYCHANGE Nil
DISPLAYEDIT .F.
IMAGE Nil
DROPPEDWIDTH Nil
ONDROPDOWN Nil
ONCLOSEUP Nil
END COMBOBOX
END WINDOW