Hi Yim,
first of make sure you can add the legend control from your toolbox, to do this simply add the mapwininterfaces.dll into your project by referencing the dll
once the legend control is available in the toolbox simply drog and drop the control into your form, after that,
look at the code below
in your form load
MyLegendl.Map = Map.GetOcx()
then in your load layer
MyShape.Open(Application.StartupPath & "\AppData\Whole\Sample.shp")
first of make sure you can add the legend control from your toolbox, to do this simply add the mapwininterfaces.dll into your project by referencing the dll
once the legend control is available in the toolbox simply drog and drop the control into your form, after that,
look at the code below
in your form load
MyLegendl.Map = Map.GetOcx()
then in your load layer
MyShape.Open(Application.StartupPath & "\AppData\Whole\Sample.shp")
Map.AddLayer(MiniShape, True)
MainHandler = MyLegend.Layers.Add(MyShape, False) 'False=it will not be visible, but once you check the layer in your legend control it will be available
MyLegend.Map.LayerName(MainHandler) = System.IO.Path.GetFileNameWithoutExtension(MyShape.Filename)
MyLegend.Layers.ItemByHandle(MyLegend.SelectedLayer).Refresh()
hope it helps