No, the simple solution is a validation rule but a more complicated solution to really filter the key pressed is possible.
First you map a userevent (ue_nonnegative) to the datawindow control event pbm_dwnkey.
double ld_value
long ll_row
if this.getcolumnname() = "value" then
if key = KeySubtract! or key = KeyDash! then
ll_row = this.GetRow()
ld_value = this.getitemnumber(ll_row, "value")
yield()
post event ue_filtervalue(ll_row, ld_value)
else
yield()
accepttext()
end if
end if
Here the datawindow has a column named value. I check if the "-" is pressed, if yes I keep the current value and a new event ue_filtervalue is posted. A yield() is necessary to make sure that the ue_filtervalue event will happen after the remaining datawindow event.
The ue_filtervalue event will restore the previous value without the "-".
this.setitem(ad_row, "value", ad_value)
this.SelectText( Len( String(ad_value)) + 1, Len( String(ad_value)) )