I want to do this in code, not with ALT+F1.
You can also do it this way:
select columnproperty(object_id('mytable'),'mycolumn','IsIdentity')
Returns 1 if it's an identity, 0 if not.