The device for controlling the queen bees egg-laying process (7) will detect the queen bee previously marked by light reactive pigments by a sensor (1) corresponding to the marking method and connected to a control unit, which, upon detection, will operate moving gates (3) connected to the device (7) by starting an engine. The device (7) with its side walls can directly be fitted to the comb (17) and the detection zone (2) of the sensor (1) will fall within the seam (16) flanked by the walls. The marked queen bee will get to the device (7) unchecked and when detected, the moving gates (3) will close and prevent the queen bee from getting out of the gates (3). Since after the gates (3) close, the space available for the queen bee is limited, the queen bee will shortly be forced to leave the device (7) in the predetermined direction of guiding (11) through the opening (8). The device also includes a (7) fence (12) and a dividing wall (10) that partly or fully include a queen excluder and keep the queen bee confined for the required period while the fence (12) and the dividing wall (10) will not prevent workers from passing through.