 |
Club Builder Foro de C++Builder en español
|
| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
Jupiter Invitado
|
Publicado: Vie 23 Jul, 2004 2:15 am Asunto: Edit tipo conmtraseña estilo Windows XP |
|
|
Hola:
Quisiera saber por donde empezar para lograr que un edit normal se convierta en un edit tipo password al estilo Xp, que aparezcan los puntos negros cuando el usuario teclea algo...
De antemano gracias,
Bye. |
|
| Volver arriba |
|
 |
Cesar C. Salazar Gonzalez Master


Registrado: 01 Oct 2002Mensajes: 2155Ubicación: San Cristóbal de Las Casas, Chiapas
|
Publicado: Vie 23 Jul, 2004 9:42 am Asunto: |
|
|
puedes utilizar la siguiente forma..
| Código: | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// en un Edit1
// EM_SETPASSWORDCHAR(0x95,0);// character to display
SendMessage( this->Edit1->Handle,
EM_SETPASSWORDCHAR ,
0x95, // en teoria este es el caracter
0L );
//al parecer windows no acepta, ese codigo
}
//--------------------------------------------------------------------------- |
o bien leer mas sobre la funcion
| Código: |
An application sends an EM_SETPASSWORDCHAR message to set or remove the password character for a single-line edit control when the user types text. When a password character is set, that character is displayed in place of each character the user types.
EM_SETPASSWORDCHAR
wParam = (WPARAM) (UINT) ch; // character to display
lParam = 0; // not used; must be zero
Parameters
ch
Value of wParam. Specifies the character to be displayed in place of the character typed by the user. If this parameter is zero, the characters typed by the user are displayed.
Return Values
This message does not return a value.
Remarks
When the EM_SETPASSWORDCHAR message is received by an edit control, the edit control redraws all visible characters by using the character specified by the ch parameter.
If the edit control is created with the ES_PASSWORD style, the default password character is set to an asterisk (*). This style is removed if an EM_SETPASSWORDCHAR message is sent with the ch parameter set to zero.
| , esto es un mensaje para definier el tipo de caracter a presentar en un Edit, con el caracter password, como el que tu quieres.. _________________
 |
|
| Volver arriba |
|
 |
mopa Cmdr

Registrado: 29 Jun 2004Mensajes: 145
|
Publicado: Vie 23 Jul, 2004 10:34 am Asunto: |
|
|
El problema esta en la fuente, tiene que tener ese simbolo.
Haz esto:
En las propiedades del TEdit:
PasswordChar=#149
Font=Arial Black.
Y listo , No hace falta enviar mensaje.
Un saludo! |
|
| Volver arriba |
|
 |
|
|
No puedes publicar temas nuevos en este foro No puedes responder a temas en este foro No puedes editar tus mensajes en este foro No puedes borrar tus mensajes en este foro No puedes votar en las encuestas de este foro
|
© 2002–2026 Club Builder · Funciona con phpBB.
|