Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Piece Of Code Not Working


Kemerd
 Share

Recommended Posts

@Dremek:

> Hey, this is me again, with a stupid non-working piece of code.
>
> TextBox2.Text = "Signed In As" + My.Settings.Username
>
> Does not work, when I'm told it should. Any ideas? This is visual basic 2010.

try:
```
TextBox2.Text = "Signed In As" & My.Settings.Username
```
Link to comment
Share on other sites

@Ryoku:

> Well in case you missed it Krumelz had the right idea.
>
> In VB6 you use & to connect strings together, not +.

Wrong, and irrelevant. I'm tired of you posting nonsense on the Q&A forums.

1\. This thread is about VB10.
2\. In both VB10 and VB6, + and & can be used for concatenation. The only difference is & forces string concatenation while + will add them if they're both integers.

@Bean:

> So, I thought that this board was for:
> "Ask for help regarding any aspect of Eclipse development."
> Not for help on VB.Net.

"Report to moderator" link.

@Dremek:

> Hey, this is me again, with a stupid non-working piece of code.
>
> TextBox2.Text = "Signed In As" + My.Settings.Username
>
> Does not work, when I'm told it should. Any ideas? This is visual basic 2010.

```
My.Settings. = ' Setting the to value
My.Settings.Save ' Saving all settings.

```
```
= My.Settings. ' Get and store it in variable.
```
Therefore:
```
My.Settings.Username = "lolepic"
My.Settings.Save
TextBox2.Text = "Signed In As " & My.Settings.Username ' Yes, I know I said the & and + are the same, but & looks nicer and forces concentration.

```
All that was with a quick Google search. It's amazing what it will do for you.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...