Click here to Skip to main content
15,924,452 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
TC2812-Nov-06 19:18
TC2812-Nov-06 19:18 
AnswerRe: How to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
coolestCoder12-Nov-06 21:04
coolestCoder12-Nov-06 21:04 
GeneralRe: How to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
TC2813-Nov-06 19:07
TC2813-Nov-06 19:07 
GeneralRe: How to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
coolestCoder14-Nov-06 18:48
coolestCoder14-Nov-06 18:48 
QuestionHow to get status of the of the wave file [modified] Pin
BabuChellathurai12-Nov-06 18:45
BabuChellathurai12-Nov-06 18:45 
Questionsaving items from a checklistbox to a database Pin
steve_rm12-Nov-06 17:51
steve_rm12-Nov-06 17:51 
QuestionHow Syncronize Outlook Address Book P2P via bluetooth Pin
pakning12-Nov-06 17:25
pakning12-Nov-06 17:25 
QuestionTextBox property Pin
andy3812-Nov-06 14:13
andy3812-Nov-06 14:13 
My Previous message 0n the 26 october 2006

Hi, using VB net(2003) I have 2 questions. First how to change dynamically the property of textAlign in a textBox, see my ex: property of textAlign in the textBox1 is already set to the right, what I would like to do is when I change the value in that txtBox would be that data move to left, and after I finish then hit tab button on keyboard data move back to the right. My second question is how to set a value like zero 0 as a default in that same textBox only when that textBox is empty. Thank you in advance for your help.


Your Answer

You just need to capture the events: Enter and Leave
> This code might help you:
>
> Private Sub TextBox1_Enter(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles TextBox1.Enter
> Me.TextBox1.TextAlign = HorizontalAlignment.Left
> End Sub
Private Sub TextBox1_Leave(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles TextBox1.Leave
> Me.TextBox1.TextAlign = HorizontalAlignment.Right
> End Sub

If you are using this code many times, you might wanna implement this code
> in your custom textbox, so you wont have to repeat this code for every
> textbox you have in your form.


Hi, good evening Alexei, Your solution for my text property is working fine thank you
Since I have about 25 textBox on that 3 pages Forms and you have mentioned that I should use a custom textbox, How to do that? And also would it be possible for the Leave Event to use either the Tab on the keyboard or the mouse. Thank you in advance for your help.

AnswerRe: TextBox property Pin
Christian Graus12-Nov-06 14:20
protectorChristian Graus12-Nov-06 14:20 
QuestionMIME Filter in .net Pin
venom0012-Nov-06 10:52
venom0012-Nov-06 10:52 
Questiontranslation from c#? Pin
ozeegers12-Nov-06 10:31
ozeegers12-Nov-06 10:31 
AnswerRe: translation from c#? Pin
Guffa12-Nov-06 10:51
Guffa12-Nov-06 10:51 
AnswerRe: translation from c#? Pin
Dave Doknjas12-Nov-06 12:34
Dave Doknjas12-Nov-06 12:34 
GeneralRe: translation from c#? Pin
ozeegers12-Nov-06 19:05
ozeegers12-Nov-06 19:05 
GeneralRe: translation from c#? Pin
ozeegers13-Nov-06 1:54
ozeegers13-Nov-06 1:54 
GeneralRe: translation from c#? Pin
ozeegers13-Nov-06 2:30
ozeegers13-Nov-06 2:30 
GeneralRe: translation from c#? Pin
Dave Doknjas13-Nov-06 4:08
Dave Doknjas13-Nov-06 4:08 
GeneralRe: translation from c#? Pin
ozeegers13-Nov-06 7:17
ozeegers13-Nov-06 7:17 
QuestionDatagrid help for newbie Pin
penguin500012-Nov-06 10:27
penguin500012-Nov-06 10:27 
QuestionHow to draw a spectral plot to a picturebox [modified] Pin
buzzztah12-Nov-06 9:39
buzzztah12-Nov-06 9:39 
AnswerRe: How to draw a spectral plot to a picturebox Pin
Christian Graus12-Nov-06 10:18
protectorChristian Graus12-Nov-06 10:18 
GeneralRe: How to draw a spectral plot to a picturebox Pin
buzzztah14-Nov-06 1:22
buzzztah14-Nov-06 1:22 
GeneralRe: How to draw a spectral plot to a picturebox Pin
Christian Graus14-Nov-06 9:41
protectorChristian Graus14-Nov-06 9:41 
QuestionReading Registry Value Pin
Puggsley12-Nov-06 9:24
Puggsley12-Nov-06 9:24 
AnswerRe: Reading Registry Value Pin
Christian Graus12-Nov-06 10:15
protectorChristian Graus12-Nov-06 10:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.