|
472
|
Programación / Programación Visual Basic / Re: Mostrar formulario con borde Fixed ToolWindow en barra de tareas
|
en: 16 Agosto 2008, 18:27 pm
|
hola fijate con las apis podes modificar los estilos de las ventanas Option Explicit Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_EXSTYLE As Long = -20 Private Const WS_EX_APPWINDOW As Long = &H40000
Private Sub Form_Load()
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW)
End Sub
Saludos
|
|
|
473
|
Programación / Programación Visual Basic / Re: RichTextBox Class [Source]
|
en: 14 Agosto 2008, 23:42 pm
|
Hola, Esta muy buena, casualmente estoy intentado hacer lo mismo pero con el SysList view32, digamos que ya casi tengo un 80% de las propiedades, pero el tema de los eventos me esta trayendo un dolor de cabeza que maldigo el momento que se me dio por intentarlo.
Saludos
|
|
|
474
|
Programación / Programación Visual Basic / Re: Run-Time error "91" en ListView Ayudass PlisS
|
en: 31 Julio 2008, 20:07 pm
|
hola prova de esta forma Dim elemento As ListItem
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then Set elemento = ListView1.HitTest(x, y) If Not elemento Is Nothing Then Set ListView1.SelectedItem = elemento PopupMenu ElMenu Set elemento = Nothing End If End If
End Sub
Saludos
|
|
|
477
|
Programación / Programación Visual Basic / Api Google Char
|
en: 23 Julio 2008, 03:09 am
|
Hola este es un ejemplo para pode utilizar el Api Google Char desde visual, bien esto puede ser utili en muy pocos caso, cuando tengamos conexion a internet y las consultas no sea muy frecuentes, asi que bien cada uno sabra si le puede dar utilidad. Aca pueden encontrar toda la informacion de como utilizar esta api http://code.google.com/apis/chart/agregar Cuatro Botones, un Picture1, y un HScroll1 Option Explicit Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long Private Declare Function GdipCreateFromHDC Lib "gdiplus" (ByVal HDC As Long, graphics As Long) As Long Private Declare Function GdipDisposeImage Lib "gdiplus" (ByVal image As Long) As Long Private Declare Function GdipDrawImageRectRectI Lib "gdiplus" (ByVal graphics As Long, ByVal image As Long, ByVal dstx As Long, ByVal dsty As Long, ByVal dstwidth As Long, ByVal dstheight As Long, ByVal srcx As Long, ByVal srcy As Long, ByVal srcwidth As Long, ByVal srcheight As Long, ByVal srcUnit As Long, ByVal imageAttributes As Long, Optional ByVal callback As Long = 0, Optional ByVal callbackData As Long = 0) As Long Private Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As Long Private Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal filename As String, ByRef image As Long) As Long Private Declare Function GdiplusStartup Lib "gdiplus" (ByRef token As Long, inputbuf As Long, Optional ByVal outputbuf As Long = 0) As Long Private Declare Sub GdiplusShutdown Lib "gdiplus" (ByVal token As Long)
Private Function RenderChar(ByVal HDC As Long, ByVal Param As String, ByVal X As Long, ByVal Y As Long, ByVal Width As Long, ByVal Height As Long) As Boolean Dim hGraph As Long Dim hImage As Long Dim hGdiPlus As Long
If URLDownloadToFile(0, "http://chart.apis.google.com/chart?chs=" & Width & "x" & Height & "&" & Param, App.Path & "\Temp.png", 0, 0) = 0 Then
GdiplusStartup hGdiPlus, 1 If GdipCreateFromHDC(HDC, hGraph) = 0 Then
If GdipLoadImageFromFile(StrConv(App.Path & "\Temp.png", vbUnicode), hImage) = 0 Then If GdipDrawImageRectRectI(hGraph, hImage, X, Y, Width, Height, 0, 0, Width, Height, &H2&, 0) = 0 Then RenderChar = True End If End If GdipDisposeImage hImage End If GdipDeleteGraphics hGraph GdiplusShutdown hGdiPlus Kill App.Path & "\Temp.png" End If End Function
Private Sub Command1_Click() Dim Param As String Param = "cht=p3&chd=t:80,40,30&chl=Sapallo|Lechuga|Tomate" Debug.Print RenderChar(Picture1.HDC, Param, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight) End Sub
Private Sub Command2_Click() Dim Param As String Param = "cht=bhs&chco=ff0000,00ff00,0000ff,&chd=s:FOE,THE,Bar&chxt=x,y&chxl=1:|Dec|Nov|Oct|0:||20K||60K||100K|" Debug.Print RenderChar(Picture1.HDC, Param, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight) End Sub
Private Sub Command3_Click() Dim Param As String Param = "cht=gom&chd=t:" & HScroll1.Value & "&chl=" & "Valor " & HScroll1.Value Debug.Print RenderChar(Picture1.HDC, Param, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight) End Sub
Private Sub Command4_Click() Dim Param As String Param = "cht=v&chd=t:100,80,60,30,30,30,10&chco=00ff00,0000ff" Debug.Print RenderChar(Picture1.HDC, Param, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight) End Sub
Private Sub Form_Load() Picture1.ScaleMode = vbPixels Picture1.Move 0, 0, 5500, 2500 HScroll1.Max = 100: HScroll1.Min = 1 End Sub
Saludos
|
|
|
|
|
|
|