elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  [DUDA] Con estilo del Form
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [DUDA] Con estilo del Form  (Leído 2,545 veces)
NsTeam

Desconectado Desconectado

Mensajes: 127


Ver Perfil
[DUDA] Con estilo del Form
« en: 25 Julio 2009, 03:28 am »

Hola a todos

tengo una duda

Weno en si, nose si se podra hacer un form al estilo que uno guste ...

un ejemplo



Bueno yo quise acer uno Asi

Pero Me refiero si abra alguna forma de hacerlo

Talves algun Code que ME Guie =)

Gracias de antemano...


En línea

h0oke


Desconectado Desconectado

Mensajes: 2.059


Coder ~


Ver Perfil WWW
Re: [DUDA] Con estilo del Form
« Respuesta #1 en: 25 Julio 2009, 03:43 am »

Pero lo que veo ahi es simplemente un background del form. A menos que tu quieras "estilizarlo" lo haría con algoritmos de formas a través de print tal vez. En recursos vb creo que estaba un ejemplo.


En línea

NsTeam

Desconectado Desconectado

Mensajes: 127


Ver Perfil
Re: [DUDA] Con estilo del Form
« Respuesta #2 en: 25 Julio 2009, 03:45 am »

Pero lo que veo ahi es simplemente un background del form. A menos que tu quieras "estilizarlo" lo haría con algoritmos de formas a través de print tal vez. En recursos vb creo que estaba un ejemplo.

Bueno

lo que esta en blanco    Seria Transparente

Osea que el Form en si sea barritas =)
En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: [DUDA] Con estilo del Form
« Respuesta #3 en: 25 Julio 2009, 03:49 am »

http://www.elguille.info/colabora/vb/Ciberwalter_FormAsDeForm.htm

hay una api por hay que hace el form transparente pero solo un color de este, con obvias razones con un background de imagen.¡!

Dulces Lunas
« Última modificación: 25 Julio 2009, 04:01 am por BlackZeroX » En línea

The Dark Shadow is my passion.
h0oke


Desconectado Desconectado

Mensajes: 2.059


Coder ~


Ver Perfil WWW
Re: [DUDA] Con estilo del Form
« Respuesta #4 en: 25 Julio 2009, 03:54 am »

Con respecto al algoritmo para conseguir "efectos"este es un code que encontré:

Código
  1. '<-- Codigo ofrecido por Tutores.org -->
  2. Private Sub Form_Resize()
  3. Form1.Cls
  4. Form1.AutoRedraw = True
  5. Form1.DrawStyle = 6
  6. Form1.DrawMode = 13
  7. Form1.DrawWidth = 2
  8. Form1.ScaleMode = 3
  9. Form1.ScaleHeight = (256 * 2)
  10. For i = 0 To 255
  11. Form1.Line (0, Y)-(Form1.Width, Y + 2), RGB(0, 0, i), BF
  12. Y = Y + 2
  13. Next i
  14. End Sub

Y con lo de forms transparentes, por internet hay módulos con muchos ejemplos.

Un saludo!
En línea

NsTeam

Desconectado Desconectado

Mensajes: 127


Ver Perfil
Re: [DUDA] Con estilo del Form
« Respuesta #5 en: 25 Julio 2009, 05:41 am »

http://www.elguille.info/colabora/vb/Ciberwalter_FormAsDeForm.htm

hay una api por hay que hace el form transparente pero solo un color de este, con obvias razones con un background de imagen.¡!

Dulces Lunas


Xvr El PRograma es interesante

Pero asta ahora NO logre hacer el form  =(

siempre que le doy f5  el form siempre aparece cuadrado

asta ahora no entiendo porque

talves tenga que ser mas curioso =)
En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: [DUDA] Con estilo del Form
« Respuesta #6 en: 25 Julio 2009, 06:53 am »

Talvez tengas que leer su codigo o como dice el About (?)

Aca dejo otro que es mucho mejor (Realmente es mejor¡!.)

Modulo.bas

Solo tiene dos funciones a cuales llamar la otra es privada asiq ue no tiene ciencia, su aplicación.¡!

Código
  1. 'Dieser Source stammt von http://www.activevb.de
  2. 'und kann frei verwendet werden. Für eventuelle Schäden
  3. 'wird nicht gehaftet.
  4. '
  5. 'Um Fehler oder Fragen zu klären, nutzen Sie bitte unser Forum.
  6. 'Ansonsten viel Spaß und Erfolg mit diesem Source!
  7.  
  8. 'Code von Benjamin Wilger
  9. 'Benjamin@ActiveVB.de
  10. 'Copyright (C) 2001
  11.  
  12. Option Explicit
  13.  
  14. Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  15. Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
  16. Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
  17. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  18. Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
  19. Private Const RGN_OR As Long = 2&
  20.  
  21. Private Declare Sub OleTranslateColor Lib "oleaut32.dll" ( _
  22.     ByVal clr As Long, _
  23.     ByVal hpal As Long, _
  24.     ByRef lpcolorref As Long)
  25.  
  26. Private Type BITMAPINFOHEADER
  27.    biSize As Long
  28.    biWidth As Long
  29.    biHeight As Long
  30.    biPlanes As Integer
  31.    biBitCount As Integer
  32.    biCompression As Long
  33.    biSizeImage As Long
  34.    biXPelsPerMeter As Long
  35.    biYPelsPerMeter As Long
  36.    biClrUsed As Long
  37.    biClrImportant As Long
  38. End Type
  39.  
  40. Private Type RGBQUAD
  41.    rgbBlue As Byte
  42.    rgbGreen As Byte
  43.    rgbRed As Byte
  44.    rgbReserved As Byte
  45. End Type
  46.  
  47. Private Type BITMAPINFO
  48.    bmiHeader As BITMAPINFOHEADER
  49.    bmiColors As RGBQUAD
  50. End Type
  51.  
  52. Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hDC As Long) As Long
  53. Private Declare Function CreateDIBSection Lib "gdi32" (ByVal hDC As Long, pBitmapInfo As BITMAPINFO, ByVal un As Long, ByVal lplpVoid As Long, ByVal handle As Long, ByVal dw As Long) As Long
  54. Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
  55. Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
  56. Private Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
  57. Private Declare Function DeleteDC Lib "gdi32" (ByVal hDC As Long) As Long
  58.  
  59. Private Const BI_RGB As Long = 0&
  60. Private Const DIB_RGB_COLORS As Long = 0&
  61.  
  62. Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
  63. Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
  64. Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
  65. Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
  66.  
  67. Private Const LWA_COLORKEY As Long = &H1&
  68. Private Const GWL_EXSTYLE As Long = (-20&)
  69. Private Const WS_EX_LAYERED As Long = &H80000
  70.  
  71. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  72. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  73. Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
  74.  
  75. Public Const WM_NCLBUTTONDOWN As Long = &HA1&
  76. Public Const HTCAPTION As Long = 2&
  77.  
  78. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  79. Public Declare Function ReleaseCapture Lib "user32" () As Long
  80.  
  81.  
  82. Public Function MakeFormTransparent(frm As Form, ByVal lngTransColor As Long)
  83.    Dim hRegion As Long
  84.    Dim WinStyle As Long
  85.  
  86.    'Systemfarben ggf. in RGB-Werte übersetzen
  87.    If lngTransColor < 0 Then OleTranslateColor lngTransColor, 0&, lngTransColor
  88.  
  89.    'Ab Windows 2000/98 geht das relativ einfach per API
  90.    'Mit IsFunctionExported wird geprüft, ob die Funktion
  91.    'SetLayeredWindowAttributes unter diesem Betriebsystem unterstützt wird.
  92.    If IsFunctionExported("SetLayeredWindowAttributes", "user32") Then
  93.        'Den Fenster-Stil auf "Layered" setzen
  94.        WinStyle = GetWindowLong(frm.hWnd, GWL_EXSTYLE)
  95.        WinStyle = WinStyle Or WS_EX_LAYERED
  96.        SetWindowLong frm.hWnd, GWL_EXSTYLE, WinStyle
  97.        SetLayeredWindowAttributes frm.hWnd, lngTransColor, 0&, LWA_COLORKEY
  98.  
  99.    Else 'Manuell die Region erstellen und übernehmen
  100.        hRegion = RegionFromBitmap(frm, lngTransColor)
  101.        SetWindowRgn frm.hWnd, hRegion, True
  102.        DeleteObject hRegion
  103.    End If
  104. End Function
  105.  
  106. Private Function RegionFromBitmap(picSource As Object, ByVal lngTransColor As Long) As Long
  107.    Dim lngRetr As Long, lngHeight As Long, lngWidth As Long
  108.    Dim lngRgnFinal As Long, lngRgnTmp As Long
  109.    Dim lngStart As Long
  110.    Dim x As Long, y As Long
  111.    Dim hDC As Long
  112.  
  113.    Dim bi24BitInfo As BITMAPINFO
  114.    Dim iBitmap As Long
  115.    Dim BWidth As Long
  116.    Dim BHeight As Long
  117.    Dim iDC As Long
  118.    Dim PicBits() As Byte
  119.    Dim Col As Long
  120.    Dim OldScaleMode As ScaleModeConstants
  121.  
  122.    OldScaleMode = picSource.ScaleMode
  123.    picSource.ScaleMode = vbPixels
  124.  
  125.    hDC = picSource.hDC
  126.    lngWidth = picSource.ScaleWidth '- 1
  127.    lngHeight = picSource.ScaleHeight - 1
  128.  
  129.    BWidth = (picSource.ScaleWidth \ 4) * 4 + 4
  130.    BHeight = picSource.ScaleHeight
  131.  
  132.    'Bitmap-Header
  133.    With bi24BitInfo.bmiHeader
  134.        .biBitCount = 24
  135.        .biCompression = BI_RGB
  136.        .biPlanes = 1
  137.        .biSize = Len(bi24BitInfo.bmiHeader)
  138.        .biWidth = BWidth
  139.        .biHeight = BHeight + 1
  140.    End With
  141.    'ByteArrays in der erforderlichen Größe anlegen
  142.    ReDim PicBits(0 To bi24BitInfo.bmiHeader.biWidth * 3 - 1, 0 To bi24BitInfo.bmiHeader.biHeight - 1)
  143.  
  144.    iDC = CreateCompatibleDC(hDC)
  145.    'Gerätekontextunabhängige Bitmap (DIB) erzeugen
  146.    iBitmap = CreateDIBSection(iDC, bi24BitInfo, DIB_RGB_COLORS, ByVal 0&, ByVal 0&, ByVal 0&)
  147.    'iBitmap in den neuen DIB-DC wählen
  148.    Call SelectObject(iDC, iBitmap)
  149.    'hDC des Quell-Fensters in den hDC der DIB kopieren
  150.    Call BitBlt(iDC, 0, 0, bi24BitInfo.bmiHeader.biWidth, bi24BitInfo.bmiHeader.biHeight, hDC, 0, 0, vbSrcCopy)
  151.    'Gerätekontextunabhängige Bitmap in ByteArrays kopieren
  152.    Call GetDIBits(hDC, iBitmap, 0, bi24BitInfo.bmiHeader.biHeight, PicBits(0, 0), bi24BitInfo, DIB_RGB_COLORS)
  153.  
  154.    'Wir brauchen nur den Array, also können wir die Bitmap direkt wieder löschen.
  155.  
  156.    'DIB-DC
  157.    Call DeleteDC(iDC)
  158.    'Bitmap
  159.    Call DeleteObject(iBitmap)
  160.  
  161.    lngRgnFinal = CreateRectRgn(0, 0, 0, 0)
  162.    For y = 0 To lngHeight
  163.        x = 0
  164.        Do While x < lngWidth
  165.            Do While x < lngWidth And _
  166.                RGB(PicBits(x * 3 + 2, lngHeight - y + 1), _
  167.                    PicBits(x * 3 + 1, lngHeight - y + 1), _
  168.                    PicBits(x * 3, lngHeight - y + 1) _
  169.                    ) = lngTransColor
  170.  
  171.                x = x + 1
  172.            Loop
  173.            If x <= lngWidth Then
  174.                lngStart = x
  175.                Do While x < lngWidth And _
  176.                    RGB(PicBits(x * 3 + 2, lngHeight - y + 1), _
  177.                        PicBits(x * 3 + 1, lngHeight - y + 1), _
  178.                        PicBits(x * 3, lngHeight - y + 1) _
  179.                        ) <> lngTransColor
  180.                    x = x + 1
  181.                Loop
  182.                If x + 1 > lngWidth Then x = lngWidth
  183.                lngRgnTmp = CreateRectRgn(lngStart, y, x, y + 1)
  184.                lngRetr = CombineRgn(lngRgnFinal, lngRgnFinal, lngRgnTmp, RGN_OR)
  185.                DeleteObject lngRgnTmp
  186.            End If
  187.        Loop
  188.    Next
  189.  
  190.    picSource.ScaleMode = OldScaleMode
  191.    RegionFromBitmap = lngRgnFinal
  192. End Function
  193.  
  194. 'Code von vbVision:
  195. 'Diese Funktion überprüft, ob die angegebene Function von einer DLL exportiert wird.
  196. Private Function IsFunctionExported(ByVal sFunction As String, ByVal sModule As String) As Boolean
  197.    Dim hMod As Long, lpFunc As Long, bLibLoaded As Boolean
  198.  
  199.    'Handle der DLL erhalten
  200.    hMod = GetModuleHandle(sModule)
  201.    If hMod = 0 Then 'Falls DLL nicht registriert ...
  202.        hMod = LoadLibrary(sModule) 'DLL in den Speicher laden.
  203.        If hMod Then bLibLoaded = True
  204.    End If
  205.  
  206.    If hMod Then
  207.        If GetProcAddress(hMod, sFunction) Then IsFunctionExported = True
  208.    End If
  209.  
  210.    If bLibLoaded Then Call FreeLibrary(hMod)
  211. End Function
  212.  
  213.  

Código
  1. MakeFormTransparent Me, vbBlack

Reincido en que hay una API que hace todo esto, solo espesificando el color y su llamada respectivamente.¡!

Dulces Lunas!¡.
« Última modificación: 25 Julio 2009, 07:19 am por BlackZeroX » En línea

The Dark Shadow is my passion.
seba123neo
Moderador
***
Desconectado Desconectado

Mensajes: 3.621



Ver Perfil WWW
Re: [DUDA] Con estilo del Form
« Respuesta #7 en: 25 Julio 2009, 18:24 pm »

Hola, cuando es asi de muchas formas, mejor usa el VB Form Shape Creator y lo dibujas, lo guardas como .frm y te genera el codigo automaticamente...

saludos.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
duda del contact form
Desarrollo Web
Chazy Chaz 2 2,026 Último mensaje 17 Abril 2011, 21:55 pm
por Chazy Chaz
duda en un form
Desarrollo Web
basickdagger 3 1,982 Último mensaje 26 Febrero 2013, 00:38 am
por basickdagger
[Duda] Imagen en el Form « 1 2 3 4 »
.NET (C#, VB.NET, ASP)
SγиtαxEяяoя 32 14,972 Último mensaje 27 Mayo 2013, 22:51 pm
por z3nth10n
Editar estilo de plugin Contact Form 7 con tema CSS
Desarrollo Web
Danick 0 2,083 Último mensaje 27 Mayo 2013, 22:02 pm
por Danick
[Duda] Mutear Form Completamente
Programación Visual Basic
Trane! 0 1,598 Último mensaje 16 Junio 2013, 15:09 pm
por Trane!
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines