Complete integration of all sample preparation steps in a microfluidic device greatly benefits point-of-care diagnostics. In the most simplistic approach, reagents are integrated in a microfluidic chip and dissolved upon filling with a sample fluid by capillary force. This will generally result in at least partial reagent wash-off during sample inflow. However, many applications, such as immunostaining-based cytometry, strongly rely on a homogeneous reagent distribution across the chip. The concept of initially preventing release (during inflow), followed by a triggered instantaneous and complete release on demand (after filling is completed) represents an elegant and simple solution to this problem. Here, we realize this controlled release by embedding antibodies in a gelatin layer integrated in a microfluidic chamber. The gelatin/antibody layer is deposited by inkjet printing. Maturation of this layer during the course of several weeks, due to the ongoing physical cross-linking of gelatin, slows down the antibody release, thereby reducing antibody wash-off during inflow, and consequently helping to meet the requirement for a homogeneous antibody distribution in the filled chamber. After inflow, complete antibody release is obtained by heating the gelatin layer above its sol–gel transition temperature, which causes the rapid dissolution of the entire gelatin/antibody layer at moderate temperatures. We demonstrate uniform and complete on-chip immunostaining of CD4 positive (CD4+) T-lymphocytes in whole blood samples, which is critical for accurate cell counts. The sample preparation is realized entirely on-chip, by applying temperature-switched antibody release from matured gelatin/antibody layers.