The present study aimed to explore the relationship between the hidden curriculum components and the affective attitudes of students' learning in high schools and to create a better learning and educational setting. The research adopted a quantitative method using a cross-sectional survey. The population consisted of 277 male high school students in District 1 of Bandar Abbas in the academic year 2019-2020. They were selected through the cluster sampling method and randomly assigned to the experimental groups. Data were gathered by the Affective Attitudes of Learning Questionnaire and the Hidden Curriculum Components Questionnaire. Structural equation modeling, Pearson correlation coefficient, and multiple regression analysis were used to analyze the data in a quantitative way. In the quantitative part, the results of multiple regression showed that there was a correlation (0.0627) between the components of the hidden curriculum with affective attitudes of learning that was significant at (0.095) confidence level. To compare the differences between the scores of the hidden curriculum components in different types of high schools, the quantitative findings showed the mean scores of most components in Exceptional Talents (SAMPAD) high school were significantly higher than the mean scores in public and non-public high schools (P <0.05). Furthermore, the results showed that the components of the hidden curriculum have a profound and lasting impact on their affective attitudes toward school, textbooks, courses, and their academic self-concept.