Reading man Dwayne Haughton is accused of killing Natasha Derby who lived at the YMCA, in Crest Road, High Wycombe, last September.
On the first day of the murder trial at Reading Crown Court, the prosecution said Haughton, 29, had shot Natasha with a single gunshot to the head as she danced with her friend at the Multicultural centre in St Mary's Road.
Police appeals for witnesses brought Haughton to their attention, the court was told.
Haughton had come forward to police later in September and said he was a by-stander after arriving with three friends at the dance, it was heard.
Like all interview witnesses, police took Haughton's fingerprints and found a match with a bullet cartridge case found in the hall, the jury was told.
In police interviews Haughton said he did not know how his prints were found to be on the case.
Haughton denies a charge of murder and a second charge of manslaughter. Haughton also denies a charge of possession of ammunition.
The trial continues.
For full indepth coverage of the trial don't miss this week's Bucks Free Press
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article