Microphase separation transition of symmetric diblock-copolymer melts confined in the thin-film geometry between parallel hard walls is studied by means of Monte Carlo simulations of a lattice model. Under a surface field which acts repulsively only on one of the two species, we investigate the order parameter profiles. Due to the competition between the two characteristic lengths, that is the natural thickness of the lamellar l and the thickness of the film D, the ordered structure depends strongly on D. In case that the two lengths do not conflict strongly, the transition from the surface-induced order at high temperatures to the bulk order at low temperatures is observed. In the opposite case, the lamellar order parallel to the surface is suppressed.