Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have five layers: polygon, line, and point with a single IRasterLayer file. I am programmatically setting the ILayer.Visible attribute for the Raster but the layer is not refreshing. If I zoom in, or zoom out, then it refreshes properly.

I tried these two methods:

mapControl.Refresh();
mapControl.Refresh(esriViewDrawPhase.esriViewAll, null, null); 

But they didn't refresh my map. What method is stronger that this for refreshing the entire map?

share|improve this question
1  
Strange, have you tried mapControl.ActiveView.Refresh()? –  Kirk Kuykendall Sep 14 '11 at 15:58
    
@Kirk Kuykendall Thanks Kirk, I had forgotten about that one. If you make an answer I'll mark as correct. –  patrick Sep 14 '11 at 16:07
add comment

1 Answer

up vote 2 down vote accepted

Apparently mapcontrol.ActiveView.Refresh() is more reliable.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.