This paper develops a Trade Network Game (TNG) that combines evolutionary game play with endogenous partner selection. Resource-constrained buyers and sellers choose and refuse trade partners on the basis of continually updated expected payoffs. Partner selection takes place in accordance with a "deferred choice and refusal" mechanism that is shown to have interesting stability, optimality, and uniqueness properties. The iterated prisoner's dilemma strategies used by buyers and sellers to conduct their trades are evolved over time via a genetic algorithm that biases reproduction in favor of strategies that have been successful in past trades. The TNG is shown to encompass a variety of economic applications, such as job search games, labor markets modelled as assignment games, labor markets with endogenously determined workers and employers, and double auction games. To illustrate the way in which preferential partner selection interacts with game play in the TNG, resulting in the endogenous formation of trade networks, a 5-trader TNG is analyzed in detail.