Hello,i found a way to do this using the ILegendGroup. There wars a post about it in the old Forums.
Dim pGroupLayer As IGroupLayer
Dim pRasterLayer As IRasterLayer
Dim pWsFact As IWorkspaceFactory
Dim pWS As IRasterWorkspace
Dim pRasterDataset As IRasterDataset
Dim pLegInfo As ILegendInfo
Dim pLegGroup As ILegendGroup
Dim pMxDocument As IMxDocument
Dim pMap As IMap
Set pMxDocument = ThisDocument
Set pMap = pMxDocument.FocusMap
' pLayer is the groupLayer where the RasterLayer should be added to
Set pGroupLayer = pLayer
' Open raster dataset in a workspace
' set up a workspace factory to open a workspace (a folder) where the Picture is stored
Set pWsFact = New RasterWorkspaceFactory
Set pWS = pWsFact.OpenFromFile(gbl_Rasterdaten_Pfad, 0)
Set pRasterDataset = pWS.OpenRasterDataset(FileName & ".tif")
Set pWsFact = Nothing
Set pWS = Nothing
' Add Layer to TOC
Set pRasterLayer = New RasterLayer
pRasterLayer.CreateFromDataset pRasterDataset
pGroupLayer.Add pRasterLayer
pGroupLayer.Expanded = True
' Hide Symbologie
Set pLegInfo = pRasterLayer
Set pLegGroup = pLegInfo.LegendGroup(0)
pLegGroup.Visible = False 'set to False to contract.
pMxDocument.ActiveView.Refresh
pMxDocument.UpdateContents
Regards, Hendrik