Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 down vote accepted

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

share|improve this answer

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.