Fungicide resistance is an important practical problem, but one that is poorly understood at the population level. Here we introduce a simple nonlinear model for fungicide resistance in botanical epidemics which includes the dynamics of the chemical control agent and the host population, while also allowing for demographic stochasticity in the host-parasite dynamics. This provides a mathematical framework for analysing the risk of fungicide resistance developing by including the parameters for the amount applied, longevity and application frequency of the fungicide. The model demonstrates the existence of thresholds for the invasion of the resistant strain in the parasite population which depend on two quantities: the relative fitness of the resistant strain and the effectiveness of control. This threshold marks a change from definite elimination of the resistant strain below the threshold to a finite probability of invasion which increases above the threshold. The fungicide decay rate, the amount of fungicide applied and the period between applications affect the effectiveness of control and, consequently, they influence whether or not resistance develops and the time taken to achieve a critical frequency of resistance. All three parameters are amenable to control by the grower or by coordinating the activity of a population of growers. Providing crude estimates of the effectiveness of control and relative fitness are available, the results can be used to predict the consequences of changing these parameters for the risk of invasion and the proportion of sites at which this might be expected to occur. Although motivated for fungicide resistance, the model has broader application to herbicide, antibiotic and antiviral resistance. The modelling approach and results are discussed in the context of resistance to chemical control in general.