Dim lIconSize As Long
lIconSize = Me.ScaleY(stdNormal.Height, vbHimetric, vbPixels)
Solo aparece si utilizo un MDIForm en lugar de un form normal ya que el MDIForm no tiene el ScaleY.
Si leen el comentario puedo reemplazar esa parte y resizar manualmente cada imagen pero no se como hacerlo, dejo todo el codigo para que lo revisen
Código:
Sub Cargar_toolbar() On Error GoTo error_handler Dim sDirPath As String sDirPath = App.path & "\imagenes\" With ucToolbar1 ' -- Vars para las imagenes Dim stdNormal As StdPicture Dim stdHot As StdPicture Dim stdDisabled As StdPicture ' -- cargar las imagenes Set stdNormal = LoadPicture(App.path & "\imagenes\normal.bmp") If Len(Dir(sDirPath & "hot.bmp")) Then Set stdHot = LoadPicture(sDirPath & "hot.bmp") If Len(Dir(sDirPath & "disabled.bmp")) Then Set stdDisabled = LoadPicture(sDirPath & "disabled.bmp") ' -- Para saber las dimensiones ' -- Nota : Si se quiere, Podes eliminar este bloque, y pasar el valor (tamaño de cada imagen) directamente ' --------------------------------------------------------------------- Dim lIconSize As Long lIconSize = Me.ScaleY(stdNormal.Height, vbHimetric, vbPixels) ' --------------------------------------------------------------------- ' -- Crear ToolBar ' --------------------------------------------------------------------- Call .BuildToolbar(stdNormal, lIconSize, "BBBBB| BBBB", stdDisabled, stdHot) ' --------------------------------------------------------------------- End With Set stdNormal = Nothing Set stdHot = Nothing Set stdDisabled = Nothing Exit Sub error_handler: MsgBox Err.Description End Sub