---
title: "QueueManager..::.MoveToHead Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_QueueManager_MoveToHead_2_6bb3b06c.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# QueueManager.MoveToHead Method 
 
Pops the specified item to the head of the queue.
 
**Namespace:** [Aurigma.GraphicsMill.WinControls](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
 **Assembly:** Aurigma.GraphicsMill.WinControls (in Aurigma.GraphicsMill.WinControls.dll)
 
## Syntax
  
```
Public Sub MoveToHead ( _item As IQueueItem, _methodIndex As Integer _
)
```
 
```csharp
public void MoveToHead(IQueueItem item,int methodIndex
)
```
 
### Parameters
 
 - item
     - Type: [Aurigma.GraphicsMill.WinControls.IQueueItem](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_IQueueItem.htm.md)
An item implementing the [IQueueItem](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_IQueueItem.htm.md) interface which should be moved to the head of the queue.

 - methodIndex
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
An index of a method which will be called for the queue.
 
## Remarks
  
Use this method to ensure that the item load its data (i.e. [EvaluateMethod(Int32)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_IQueueItem_EvaluateMethod_1_e1836fc4.htm.md) executes) as soon as possible. It is important when you are going to have a lot of items in a control and want to load thumbnails or other item details by demand. For example, when the user loads 500 items, the queue is organized the same order as they are appear on the screen. If the user scrolls the control to, say, 400th item, he/she would not like to wait until all invisible items before 400th one will be loaded. The user expects that priority of visible items will be increased.
 
To provide such behavior it is recommended to call this method when the control requests a thumbnail (i.e. in [GetIconKey(View)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_IListItem_GetIconKey_1_033ca863.htm.md) method implementation). This way when the user scrolls the control and items start repainting, the control calls the [GetIconKey(View)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_IListItem_GetIconKey_1_033ca863.htm.md). If no thumbnail available, you should pop this item to the head of the queue. This way you increase the priority of visible items.
 
Keep in mind, the [ThumbnailListItem](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_ThumbnailListItem.htm.md) class already implements this approach. You need to use [QueueManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_QueueManager.htm.md) only if you are creating your own list item class (i.e. implement [IListItem](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_IListItem.htm.md) and [IQueueItem](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_IQueueItem.htm.md) interfaces yourself).
 
It is recommended to start queues execution via [StartQueues()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_QueueManager_StartQueues.htm.md) method every time you move the item to the head.
   
## See Also

### Reference

- [QueueManager Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_QueueManager.htm.md)
- [Aurigma.GraphicsMill.WinControls Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
