Autor Tema: ucTextBox igual a esta (Practicando)  (Leído 4129 veces)

0 Usuarios y 1 Visitante están viendo este tema.

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
ucTextBox igual a esta (Practicando)
« en: Noviembre 01, 2012, 02:12:19 pm »
Siguiendo lo que postee aca: http://leandroascierto.com/foro/index.php?topic=1930.0

Esta función dibuja un cuadro con las puntas redondeadas.
Código: (VB) [Seleccionar]
Private Sub DrawButton()

    Dim PT As POINTAPI, Pen As Long, hPen As Long
    Dim i As Long, ColorR As Long, ColorG As Long, ColorB As Long
    Dim hBrush As Long
       
    UserControl.Cls
       
    With UserControl
   
      'hBrush = CreateSolidBrush(RGB(0, 60, 116))
      hBrush = CreateSolidBrush(RGB(194, 193, 193))
      FrameRect UserControl.hdc, rc, hBrush
      DeleteObject hBrush
     
      'Left top corner
      SetPixel .hdc, l, t + 1, RGB(205, 207, 209)
      SetPixel .hdc, l + 1, t + 1, RGB(232, 232, 234)
      SetPixel .hdc, l + 1, t, RGB(205, 207, 209)
     
      'right top corner
      SetPixel .hdc, r - 1, t, RGB(205, 207, 209)
      SetPixel .hdc, r - 1, t + 1, RGB(232, 232, 234)
      SetPixel .hdc, r, t + 1, RGB(205, 207, 209)
     
      'left bottom corner
      SetPixel .hdc, l, B - 2, RGB(205, 207, 209)
      SetPixel .hdc, l + 1, B - 2, RGB(232, 232, 234)
      SetPixel .hdc, l + 1, B - 1, RGB(205, 207, 209)
     
      'right bottom corner
      SetPixel .hdc, r, B - 2, RGB(205, 207, 209)
      SetPixel .hdc, r - 1, B - 2, RGB(232, 232, 234)
      SetPixel .hdc, r - 1, B - 1, RGB(205, 207, 209)
           
    End With
   
    DeleteObject regMain
    regMain = CreateRectRgn(0, 0, w, h)
    rgn1 = CreateRectRgn(0, 0, 1, 1)              'Left top coner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    rgn1 = CreateRectRgn(0, h - 1, 1, h)          'Left bottom corner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    rgn1 = CreateRectRgn(w - 1, 0, w, 1)          'Right top corner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    rgn1 = CreateRectRgn(w - 1, h - 1, w, h)      'Right bottom corner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    SetWindowRgn UserControl.hwnd, regMain, True
 
End Sub

A partir de acá como puedo pintar la linea roja y el verde.



SOURCE DEL PROYECTO
http://www.mediafire.com/?4nmcc54d59d56cc
« última modificación: Noviembre 01, 2012, 02:35:47 pm por E N T E R »
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo

79137913

  • Megabyte
  • ***
  • Mensajes: 185
  • Reputación: +21/-4
  • 4 Esquinas
    • Ver Perfil
    • Eco.Resumen Resumenes Cs. Economicas
Re:ucTextBox igual a esta (Practicando)
« Respuesta #1 en: Noviembre 01, 2012, 03:00:48 pm »
HOLA!!!

Mira, yo lo encararia de esta manera (mucho menos codigo)

fijate:

http://www.mediafire.com/?ftew4xfcy075csr

GRACIAS POR LEER!!!
"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*                                                          Resumenes Cs.Economicas

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
Re:ucTextBox igual a esta (Practicando)
« Respuesta #2 en: Noviembre 01, 2012, 03:29:48 pm »
Interesante 79137913, vamos a mirar a ver que sale.
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo

LeandroA

  • Administrador
  • Petabyte
  • *****
  • Mensajes: 1128
  • Reputación: +151/-8
    • Ver Perfil
Re:ucTextBox igual a esta (Practicando)
« Respuesta #3 en: Noviembre 01, 2012, 03:44:08 pm »
Hola ENTER, va queriendo, hay muchas formas que se me ocurren pero bueno, dale como lo estas haciendo, por lo que preguntas agregas estas dos lineas


Código: [Seleccionar]
      UserControl.Line (0, 0)-(23, UserControl.ScaleHeight), RGB(238, 238, 238), BF
      UserControl.Line (23, 0)-(23, UserControl.ScaleHeight), RGB(194, 193, 193)


Código: [Seleccionar]
Private Sub DrawButton()

    Dim PT As POINTAPI, Pen As Long, hPen As Long
    Dim i As Long, ColorR As Long, ColorG As Long, ColorB As Long
    Dim hBrush As Long
       
    UserControl.Cls
       
    With UserControl
   
      UserControl.Line (0, 0)-(23, UserControl.ScaleHeight), RGB(238, 238, 238), BF
      UserControl.Line (23, 0)-(23, UserControl.ScaleHeight), RGB(194, 193, 193)
   
      'hBrush = CreateSolidBrush(RGB(0, 60, 116))
      hBrush = CreateSolidBrush(RGB(194, 193, 193))
      FrameRect UserControl.hdc, rc, hBrush
      DeleteObject hBrush
     
      'Left top corner
      SetPixel .hdc, l, t + 1, RGB(205, 207, 209)
      SetPixel .hdc, l + 1, t + 1, RGB(232, 232, 234)
      SetPixel .hdc, l + 1, t, RGB(205, 207, 209)
     
      'right top corner
      SetPixel .hdc, r - 1, t, RGB(205, 207, 209)
      SetPixel .hdc, r - 1, t + 1, RGB(232, 232, 234)
      SetPixel .hdc, r, t + 1, RGB(205, 207, 209)
     
      'left bottom corner
      SetPixel .hdc, l, B - 2, RGB(205, 207, 209)
      SetPixel .hdc, l + 1, B - 2, RGB(232, 232, 234)
      SetPixel .hdc, l + 1, B - 1, RGB(205, 207, 209)
     
      'right bottom corner
      SetPixel .hdc, r, B - 2, RGB(205, 207, 209)
      SetPixel .hdc, r - 1, B - 2, RGB(232, 232, 234)
      SetPixel .hdc, r - 1, B - 1, RGB(205, 207, 209)
     

           
    End With
   
    DeleteObject regMain
    regMain = CreateRectRgn(0, 0, w, h)
    rgn1 = CreateRectRgn(0, 0, 1, 1)              'Left top coner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    rgn1 = CreateRectRgn(0, h - 1, 1, h)          'Left bottom corner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    rgn1 = CreateRectRgn(w - 1, 0, w, 1)          'Right top corner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    rgn1 = CreateRectRgn(w - 1, h - 1, w, h)      'Right bottom corner
    CombineRgn regMain, regMain, rgn1, RGN_DIFF
    DeleteObject rgn1
    SetWindowRgn UserControl.hwnd, regMain, True
 
End Sub

Saludos.

79137913

  • Megabyte
  • ***
  • Mensajes: 185
  • Reputación: +21/-4
  • 4 Esquinas
    • Ver Perfil
    • Eco.Resumen Resumenes Cs. Economicas
Re:ucTextBox igual a esta (Practicando)
« Respuesta #4 en: Noviembre 01, 2012, 03:45:43 pm »
HOLA!!!

Te diria que guardes la funcion que coloque es muy util, redondeas las puntas de cualquier control (incluso el form)

GRACIAS POR LEER!!!
"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*                                                          Resumenes Cs.Economicas

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
Re:ucTextBox igual a esta (Practicando)
« Respuesta #5 en: Noviembre 01, 2012, 03:51:55 pm »
Buenisimo Leandro, gracias bro...
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
Re:ucTextBox igual a esta (Practicando)
« Respuesta #6 en: Noviembre 01, 2012, 03:53:03 pm »

Te diria que guardes la funcion que coloque es muy util, redondeas las puntas de cualquier control (incluso el form)


Claro man ya se me ocurrio para un proyecto que tube dibujar en paint cada picture
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo

Cudder

  • Bytes
  • *
  • Mensajes: 26
  • Reputación: +0/-1
    • Ver Perfil
Re:ucTextBox igual a esta (Practicando)
« Respuesta #7 en: Noviembre 16, 2012, 04:22:17 pm »
HOLA!!!

Mira, yo lo encararia de esta manera (mucho menos codigo)

fijate:

http://www.mediafire.com/?ftew4xfcy075csr

GRACIAS POR LEER!!!

Hola I like your example and I wondered if you could make a txtBox like this one:


79137913

  • Megabyte
  • ***
  • Mensajes: 185
  • Reputación: +21/-4
  • 4 Esquinas
    • Ver Perfil
    • Eco.Resumen Resumenes Cs. Economicas
Re:ucTextBox igual a esta (Practicando)
« Respuesta #8 en: Noviembre 19, 2012, 06:41:49 am »
HOLA!!!

Picture DOWN plz re-Upload

GRACIAS POR LEER!!!
"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*                                                          Resumenes Cs.Economicas