Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 05-22-2006, 10:52 AM   #1 (permalink)
Junkie
 
SirLance's Avatar
 
Location: In the middle of the desert.
VB .Net -- manipulating a status bar from a module

I'm new to .net and I'm a bit frustrated by something.

In VB 6, if I put a status bar on a form, and I want to change it's .txt property from another form or a module, I'd say form1.statusbar.txt = "The Text".

If I try something similar in .net, it doesn't work. The message is "reference to a non-shared member requires an object reference."

OK, fine. I don't give a crap. All I'd like to do is change the form's status bar's text from someplace other than in the form. Can someone give me an example?

TIA!
__________________
DEMOCRACY is where your vote counts, FEUDALISM is where your count votes.
SirLance is offline  
Old 05-22-2006, 08:47 PM   #2 (permalink)
Crazy
 
When .NET compiles, it requires a reference to every control (module) that exists on the page. You should be able to reference the control via its "Name" property, which by default, ends up being the name of the reference.

So, instead of form1.statusbar.Text = "Whoah", you'd do: statusbar.Text = "Whoah"

If you're trying to reference a control from a different page, then you're going to need a reference to that page. I don't have an example I could cut/paste right now because my code is on another machine. But if this is your issue, then I'd look up "Context.Handler"- that's an easy way to grab controls from past pages.

Last edited by Robaggio; 05-22-2006 at 08:49 PM..
Robaggio is offline  
Old 05-25-2006, 10:10 AM   #3 (permalink)
Junkie
 
SirLance's Avatar
 
Location: In the middle of the desert.
Thanks for the reply!

What I wound up doing was putting a timer on the form and have the tick event check the value of a public variable, and set the status bar accordingly.

I'll look into context.handler, thanks for the tip!
__________________
DEMOCRACY is where your vote counts, FEUDALISM is where your count votes.
SirLance is offline  
 

Tags
bar, manipulating, module, net, status

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 01:20 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73