There has recently been a renewed interest in integrating programming into the curriculum of primary education, partly due to the availability of the visual programming environment (VPE) designed for educational purposes. While substantial progress on exploring the potential benefits of VPE has been achieved, much remains to be done to understand students' acceptance of VPE and whether gender difference plays a role in their acceptance. This study was thus designed to extend the technology acceptance model to identify determinants influencing boys' and girls' behavioural intention to use VPE in the primary school context. It used a mixed method approach to evaluate the proposed model using questionnaire and interview data collected from 431 students (296 boys and 135 girls) in 38 primary schools. Among boys and girls, computer self-efficacy is shown to be the external factor significantly influencing both perceived usefulness and perceived ease of use of VPE, while attitude towards VPE is found to have a significant effect on behavioural intention to use VPE. In addition, gender differences are found in the impact of social influence and external encouragement on students' perceptions towards VPE, and also in the impact of students' perceptions towards VPE on their behavioural intention to use it. Based on the findings, several recommendations are made to encourage primary students to use VPE for programming. Copyright © 2018 Elsevier Ltd. All rights reserved.