neohaa.blogg.se

Vb net 2010 inputbox
Vb net 2010 inputbox






vb net 2010 inputbox

Private Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click Public Overridable Overloads Function Show(ByVal sPrompt As String, ByVal sTitle As String, Optional ByVal sDefaultValue As String = "") As String Public Sub New(ByVal cBackColor As Color, ByVal cForeColor As Color) Je suis sûr que ce bout de code qui remplace la dialog de VB6 sera trés utile aux débutant comme moi, donc merci de votre aide.Ĭordialement c'est pas un usercontrol en plus Private Sub txtValue_KeyDown(ByVal sender As Object, ByVal e As ) Handles txtValue.KeyDown Public Shared Function affiche(ByVal prompt As String, _īyVal title As String, ByVal defaultVal As String, _īyVal couleur_fond As Color, ByVal couleur_texte As Color) As Stringĭlg.FormBorderStyle =

vb net 2010 inputbox

' create an InputDialog window, and return the typed text, et modif des couleurs et format de border de la form =) ' preselect the text, and give the focus to this control Shared valide As Boolean = False 'modif !marche poa! je veux qu'un enter sur la saisie du code valide la form Me.lblPrompt.Anchor = CType(((.Top Or .Left) _ Me.txtValue.Anchor = CType(((.Top Or .Left) _ Me.btnCancel.Anchor = CType((.Bottom Or .Right), ) Me.btnOK.Anchor = CType((.Bottom Or .Right), ) 'It can be modified using the Windows Form Designer.įriend WithEvents btnOK As įriend WithEvents btnCancel As įriend WithEvents txtValue As įriend WithEvents lblPrompt As 'NOTE: The following procedure is required by the Windows Form Designer Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) 'Form overrides dispose to clean up the component list. 'Add any initialization after the InitializeComponent() call 'This call is required by the Windows Form Designer. #Region " Windows Form Designer generated code " ' Example: MessageBox.Show(InputDialog.InputBox("Type your name:", "Test", ' Create an InputBox like the one of VB6. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loadĭim code As String = InputDialog.affiche("Saisir votre code", "bienvenue", "****", coul_fond, coul_text)Īvec le code ci dessous pour la class InputDialog : Pour tester la fonction : copier ce code dans une classe d'un nouveau projet et appellez la class via la form du projet : J'éspére être explicite, car visiblement y'a un truc que j'ai pas pigé Voici mon soucis : J'ai récupéré et modifié la source de Marco Bellinaso, mais voila pas possible d'activer le si l'user appui sur la touche ENTER lors de la saisie de la valeur (obligé de cliquer sur OK, c'est saoulant non ?).








Vb net 2010 inputbox