By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,725 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

What is wrong with Designer? Task List errors...

P: n/a
Hi,

I wanted to insert linebreaks in the tooltip property of some of my
controls.
I simply altered the designer generated code in InitializeComponent:

Me.MyTooltip.SetToolTip(Me.TextBox1, "Text line 1" & vbCr & "Text line 2.")

But whenever I change back to desinger I get this error in the Task List:
"The variable 'vbCr' is either undeclared or was never assigned."

I've encountered similar problem before when I've e.g. inherited the data
grid textbox and used the altered data grid textbox within a datagrid and
the designer always deleted the code related to the inherited data grid
textbox. In this case I just had no choice but to put the related code in
sub new of the form.

I even tried something like this:

Private strToolTip As System.String

Me.strToolTip = New System.String("Text line 1" & vbCr & "Text line 2.")
Me.MyTooltip.SetToolTip(Me.TextBox1, Me.strToolTip)

But then I get the error: "The variable 'strToolTip' is either undeclared or
was never assigned."
It seems to me that you can't even declare a variable and use it
InitializeComponent sub.
I sure could put the code in sub new of the form or in form load, to get it
work but this is not about that. I simply want to know how to get it work
straight within InitializeComponent.
I tried everythink to get it work but no success! This is strange behaviour!
Isn't it?
Am I missing something here?
--
Thanks in advance
Ali Eghtebas Sweden
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello,

"Ali Eghtebas" <al***@home.se> schrieb:
I wanted to insert linebreaks in the tooltip property of some of my
controls.
I simply altered the designer generated code in InitializeComponent:

Me.MyTooltip.SetToolTip(Me.TextBox1, "Text line 1" & vbCr & "Text line 2.")
But whenever I change back to desinger I get this error in the Task List:
"The variable 'vbCr' is either undeclared or was never assigned." [...] I sure could put the code in sub new of the form or in form load, to get it work but this is not about that. I simply want to know how to get it work
straight within InitializeComponent.


I am able to reproduce the behavior. IMHO you should not alter the Designer
Generated Code. Maybe you can add the code to the Load event handler.

HTH,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Jul 19 '05 #2

P: n/a
Also, unless .NET does something wierd with tooltips, Multiline tooltips
only work in 2000+

--
Happy to help,
-- Tom Spink
(th**********@ntlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Hello,

"Ali Eghtebas" <al***@home.se> schrieb:
I wanted to insert linebreaks in the tooltip property of some of my
controls.
I simply altered the designer generated code in InitializeComponent:

Me.MyTooltip.SetToolTip(Me.TextBox1, "Text line 1" & vbCr & "Text line 2.")

But whenever I change back to desinger I get this error in the Task List: "The variable 'vbCr' is either undeclared or was never assigned."

[...]
I sure could put the code in sub new of the form or in form load, to get

it
work but this is not about that. I simply want to know how to get it work straight within InitializeComponent.


I am able to reproduce the behavior. IMHO you should not alter the

Designer Generated Code. Maybe you can add the code to the Load event handler.

HTH,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.