|
your question confuses me.
/\ |_ E X E GG
|
|
|
|
|
Alex Eggie:
I am interested in adding a panel to the status bar that simply displays text starting from the time that the application begins. The text originally displays (0 Hours, 0 Minutes, 0 Seconds) and then increments each second in the format (X Hours, X Minutes, X Seconds) using a Timer control. However, I am not certain how to assign the current value for the timerStatusBar (timer control) to the statusBarPanelTimer control (panel in status bar) text property. I also need to be able to parse out the time from the Timer control in terms of hours, minutes and seconds, but I am uncertain where to even get the current value of the Timer control.
statusBarPanelTimer.Text = ?(timerStatusBar.Text does not exist)
Also, I would like to position the panel in the status bar either aligned to the right or to even position the status bar panel at a SPECIFIC location in the status bar. Would appreciate assistance.
Cordially,
New_Phoenix
|
|
|
|
|
So, you just want to display the time (hours, minutes, seconds) in a status bar?
Um, just add to your timer.tick method, statusBar.PanelWhatever.Text=DateTime.Now.toShortTimeString;
is that what you want??? I still don't understand exactly.
/\ |_ E X E GG
|
|
|
|
|
I think I got it...
When you application starts you need to remember the start time. So in your main form declare a variable like:
<br />
private DateTime startTime = DateTime.Now;<br />
Now in your Timer.Tick eventhandler do the following:
<br />
TimeSpan ts = DateTime.Now - startTime;<br />
string text = ts.Hours + " Hours, " + ts.Minutes + " Minutes, " + ts.Seconds + " Seconds";<br />
statusBarPanelTimer.Text = text;<br />
Regarding the other question: Have a look at the propertiesof the status bar panel. There is something like Alignment which you can use to align it to the right. A specific location can only be made by having all AutoSize properties of the statusbar panels to the left to false and assigning fix widths to them.
|
|
|
|
|
Robert Rohde:
Thanks, it worked great! Much appreciated!
Cordially,
New_Phoenix
|
|
|
|
|
Hi,
I'm fairly new to c# and I can't seem to access another object from another class when it is public, how can I do this? This is a much simplified version of the code:
public class Entry<br />
{<br />
public M2 ds1 = new M2();<br />
[STAThread]<br />
static void Main()<br />
{<br />
M1 test = new M1("hi");<br />
}<br />
}<br />
public class M1<br />
{<br />
public M1(string data)<br />
{<br />
ds1.Add(data);
}<br />
}<br />
public class M2<br />
{<br />
ArrayList data1 = new ArrayList();<br />
public M2()<br />
{<br />
}<br />
public void AddData(string data)<br />
{<br />
data1.Add(data);<br />
}<br />
}
|
|
|
|
|
Your problem hasnt much to do with C#. You should read some basic book about object oriented programming.
You cannot directly access ds1 of class Entry. For this you either need to declare the field static (which means there is only one value for the whole class and not for each instance) or access the field from an instance of the Entry class.
|
|
|
|
|
I need programmatic control device volume, location of that is :
control panel->sounds and audio device properties->device volume.
Or in the bottom right angle(volume icon).
Can i do this with .NET library? If no how do this with using WinAPI and С#?
|
|
|
|
|
I'm using Remoting with Configuration Files on the server and on the client.
I've read that after RemotingServices.Configure(filename) I can use the new operator to
get the remoted object from the server. But how does the compiler know to get the remoting object from the server and not simply creates a new object of the RemotableClass?
RemotingServices.Configure("Client.config")
RemotableClass rem = new RemotableClass();
Thanks.
|
|
|
|
|
Please advise me.
Thank You.
Sorry for bad English
|
|
|
|
|
I'm reading Inside C#. I 've just written a "Hello World" console app w/ VS.NET
I want to 'get into' the dumpbin. I then open a command prompt and change to the the folder w/ the App. It makes it all the way to:
dumpbin /HEADERS /CLRHEADER
But as soon as I append HelloWorld.exe I get a LINK 1181 error.
I then went to the "Path" and added the \bin and \VsaEnv folders (I think)
Tried it again- same error. Any ideas??? - thanks very much - this is very frustrating...
|
|
|
|
|
I have a simple HashTable defined that has a few objects in it as follows:
HashTable myHashTable = new HashTable();
Queue q12 = new Queue();
Queue q22 = new Queue();
Queue q33 = new Queue();
myHashTable.Add("A",q12);
myHashTable.Add("G",q22);
myHashTable.Add("K",q33);
How can I directly retrieve the 2nd queue (or the nth queue) in this list. Here is what
I tried that does not work
int n=1;
Queue myNthQueue = (Queue)
DictionaryEntry myEntry = (DictionaryEntry) userHashTable[n];
Queue whichQueueToPopFrom = (Queue) myEntry.Value;
string whichQueueToPopFromName = (string) myEntry.Key;
This compiles, but complains about nulls and does not work.
Any suggestions would be appreciated.
|
|
|
|
|
A Hashtable has no order. If you want to access items via key AND index you will have to search for another (hybrid style) class. I dont think there is one in the .NET framework, but I think there is one in the VisualBasic.Compatibility namespace which you can also use from within C#.
|
|
|
|
|
I typically have a small number of items in this class. Can I iterate through it and will the iteration always go in the same order if the items in the class don't change. (ie, no adds or removes)
|
|
|
|
|
|
i have been creating a program which is able to run over the internet bypassing the proxy server. is there a way for my client to connect to the server (using sockets)as well as receive/download files from the server?
thank you
|
|
|
|
|
|
did you use httpwebrequest/httpwebresponse and webproxy? is it possible to use those in socket programming?
|
|
|
|
|
Hmm. Not sure. I didn't actually go through a proxy.
Sorry
|
|
|
|
|
oh ok.. did you use webrequest and webresponse in your code?
|
|
|
|
|
|
how would you enable that, im using visual studio 2005 beta 1, .net framework 2.0 beta 1. i have the following controls set...
autocompletecustomsource = collection, it goes in an editor...
autocompletemode = suggest...
autocompletesource = custom source...
where am i going wrong? it doesn't work with those settings.
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Hi, I have a collection in a control i'm making (extends collectionbase), and in all the functions i embody the code in lock(List.SyncRoot){}. for ex:
<br />
public void Add(string text)<br />
{<br />
lock(List.SyncRoot)<br />
{<br />
List.Add(new SimpleListItem(text));<br />
<br />
OnItemsAdded(this, new System.EventArgs(), List.Count - 1);<br />
}<br />
}<br />
I plan to use the control asynch like when i add items to it, so is it necessary that i use the lock thing the way i described?
|
|
|
|
|
Windows forms, C#, Visual Studio .NET 2003.
In a MDI application, we have a MDI child form that starts out maximized [window "A"]. This mdi child form has the option to open a different "editing" window as a non-modal child [window "B"].
If I set the properties "B" to be a MDI child, it will start out maximized, which we don't want. If, however, I set the properties of "B" as simply a Child of "A", then it remains a child of the MDI application (good), it remains non-maximized (good) BUT: we can no longer edit text in the text box in a "normal" fashion.
The behavior is such that you can't take your cursor and highlight all of the text in the text box. You have to click in the text box, in which the cursor will force to the beginning, then you have to use your keyboard keys such as "End" and the backspace key to actually edit the text.
Have tried various combinations of MDI Child but fixed borders and no control boxes and such, but the issue keeps coming up that in order to get the editing normal, it seems as if I MUST keep the form "B" as a MDI Child and thus it either maximizes, which I don't want, or it un-maximizes form "A" which I don't want.
Any suggestions would be greatly appreciated.
================
Thank you
Sue
|
|
|
|
|
OK. This is all normal Windows functionality:
1) If one Child form of an MDI Parent is maximized, all the children are maximized. You can't mix it so one is maximized and other are not.
2) A Child Form cannot be both a child and a parent to another form. If you attempt to do this, the results are undefined and unpredictable, which you've already noticed.
The only solution you have to both problems at the same time is to make the second child form a seperate window, with no parent. This will make the child form just like any other window with no interaction with the MDI Parent. But, I suspect you don't want this either.
In that case, there is no solution to your problem. Your requirements will have to be modified to fit within the functional limitations of Windows.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|