473,770 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating status bar from a class library

Hi Everyone,

I'm very new to C# and I have the following problem - please help.

I have a Windows Forms application called 'FunApp' which has a status
bar. I also have a separate class library called FunTx compiled as a
DLL.

What I want to do is update the status bar from within a FunTx method -
and I used delegates to try this. Here's what I did.

FunApp
--------
delegate void SetStatusBar(vo id)

in a method of FunApp, I instantiated this

SetStatusBar sb = new SetStatusBar(Se tStatusbarText) ;
where SetStatusBarTex t is a method that sets the .Text property of the
status bar.

I do the usual stuff like
FunTx ft = new FunTx();
ft.FunProcess(s b,n);

FunTx (separate class library - DLL)
-----
in FunTx I have a method called FunProcess

public void FunProcess(SetS tatusBar sb, int y)
{
.....do something....
sb("And now update the status bar");
}
But nothing happens. No change in status bar. What am I doing wrong?
Any help (other ways to do too) is greatly appreciated.

thanks!

Nov 16 '05 #1
2 2121
Hi,

Your delegate seem to accept no parameters. How do you expect FunTx to pass
the updated message to be displayed on the status bar?

This line:
sb("And now update the status bar");
should upset the compiler!

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Venu" <mr**********@y ahoo.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. . Hi Everyone,

I'm very new to C# and I have the following problem - please help.

I have a Windows Forms application called 'FunApp' which has a status
bar. I also have a separate class library called FunTx compiled as a
DLL.

What I want to do is update the status bar from within a FunTx method -
and I used delegates to try this. Here's what I did.

FunApp
--------
delegate void SetStatusBar(vo id)

in a method of FunApp, I instantiated this

SetStatusBar sb = new SetStatusBar(Se tStatusbarText) ;
where SetStatusBarTex t is a method that sets the .Text property of the
status bar.

I do the usual stuff like
FunTx ft = new FunTx();
ft.FunProcess(s b,n);

FunTx (separate class library - DLL)
-----
in FunTx I have a method called FunProcess

public void FunProcess(SetS tatusBar sb, int y)
{
....do something....
sb("And now update the status bar");
}
But nothing happens. No change in status bar. What am I doing wrong?
Any help (other ways to do too) is greatly appreciated.

thanks!


Nov 16 '05 #2
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.c om> wrote in message news:<OX******* *******@TK2MSFT NGP14.phx.gbl>. ..
Hi,

Your delegate seem to accept no parameters. How do you expect FunTx to pass
the updated message to be displayed on the status bar?

This line:
sb("And now update the status bar");
should upset the compiler!

Hi Dmitriy,
Yes it did :) (after I posted the Q) because I was mistakenly not
compiling my class library. Anyway, now I'm lost - I don't know how to
do this. Is there some way I can accomplish this thru my class
library?

-v

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Venu" <mr**********@y ahoo.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
Hi Everyone,

I'm very new to C# and I have the following problem - please help.

I have a Windows Forms application called 'FunApp' which has a status
bar. I also have a separate class library called FunTx compiled as a
DLL.

What I want to do is update the status bar from within a FunTx method -
and I used delegates to try this. Here's what I did.

FunApp
--------
delegate void SetStatusBar(vo id)

in a method of FunApp, I instantiated this

SetStatusBar sb = new SetStatusBar(Se tStatusbarText) ;
where SetStatusBarTex t is a method that sets the .Text property of the
status bar.

I do the usual stuff like
FunTx ft = new FunTx();
ft.FunProcess(s b,n);

FunTx (separate class library - DLL)
-----
in FunTx I have a method called FunProcess

public void FunProcess(SetS tatusBar sb, int y)
{
....do something....
sb("And now update the status bar");
}
But nothing happens. No change in status bar. What am I doing wrong?
Any help (other ways to do too) is greatly appreciated.

thanks!

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2350
by: willow1480 | last post by:
I am developing a small little Service Control Application. I am using a listview control with checkboxes and getting the list of services I want to control from a text file. When you check a checkbox, it should either stop the service or start the service depending on each respective service's status. I want the listView to update the status for each service as they are checked. instead all I can seem to do is clear the listView and I...
4
3556
by: Art | last post by:
Hi, I have a main form for my project. It uses a routine in another class to do work on a file -- line by line. I'd like to have a text box on my form display the lines, say every 5,000 -- so I can tell the progress. From what LITTLE I know it looks like I'd have to pass the form to the class so that the class can refer back to the form and update the textbox. It seems to me that there must be a better way to handle this. Can anyone...
2
1573
by: timc_fla | last post by:
Ok, here's the scenario: I have a form with a status bar on it. I have a class that does a LOT of processing. I want to update the status bar text property periodically from within the class by passing a reference of the status bar to the class. In VB6 this is pretty straightforward, but I just can't seem to get it figured out in vb.net. Should I be trying to do it this way in .net or what?
3
2439
by: Looch | last post by:
Hi all, Here's the code I'm using: Dim sqlCnn As New SqlConnection(cnn) Dim sqlCmd As New SqlCommand("Update AMS.dbo.Call_Log Set Status = @status, UPSTrack = @ups where TicketNumberActual = @ticketnumber", sqlCnn) sqlCmd.Parameters.AddWithValue("@ticketnumber", SqlDbType.BigInt.ToString())
11
8336
by: jjw92 | last post by:
I've been banging my head against the wall with this one for a couple days so I'm hoping someone has some ideas. I have a web service that I created that is called by a .NET class library (which in turn is called by another application). This all works fine in my development environment. Test environment: Windows Server 2003, ASP 6.0, .NET 2.0, Anonymous authentication is enabled. All components (web service, DLL, and calling application)...
14
2172
by: bcap | last post by:
Hello, I really would apprciate help! =) What I want to do is be able to change the status of mulitple records using a drop down and a checkbox. I have a drop down called "ChangeStatus" with the values to change the status to Pending, Accepted, Declined, Cancelled, Completed.
0
997
by: jchavez | last post by:
When updating a column from a single row in a table from one server that is in replication with another server why doesn't the whole row update? Example Server 1 Table:CustomerInfo Columns: ID, Customer, Address, Status Data:
1
5803
by: K Viltersten | last post by:
> bar.PerformStep (); I noticed that there's a property for the bar stating what time it should take for the animation to move the fill to the requested spot. I'm guessing that's the time i should delay my text updating by. Correct? When you mentioned a delay - is there an other way to do it than threads? I've found this solution.
0
1315
by: Edwin.Madari | last post by:
updated creature running in its own thread will get you started. try it foryourself, change sleep times per your need. import os, sys, threading, time class Creature: def __init__(self, status): self.status = status self.state = 'run' def start(self): self.athread = threading.Thread(target=self.print_status)
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9869
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.