|
The visual style for all of the .NET frameworks is what the machine is currently using. With XP for example, their are 3 visual styles: luna, metallic, and homestead. All of the .NET frameworks (as long as the code or manifest files are provided in the application) will use the visual style specified. The main differences in the UI between .NET 1.1 and .NET 2.0 would have to be the new ToolStrip, MenuStrip, and ContextStrip which are still dependent on the visual style (if render property is system defined). The strips which have replaced the menus and toolbars of .NET 1.x have a newer appearance that can only be used on systems with the .NET 2.0 framework installed. This new appearance will help in giving your application an interface similar to that of Office 2000-2003.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
can anyone give me a link or source code of a simple text transfer from a pc to a phone or vica versa through a usb dongle.
Ashutosh
|
|
|
|
|
|
hi
i have a html table in my webpage that it's link to another page, i want when user mouse over on it,a context menu show user that select which page
want to view,but how to do ?(like menu)
thanks
|
|
|
|
|
Hi
How i get a multiline in datagrid
Karthik
|
|
|
|
|
Hello,
I am trying to capture changes in a logfile (which is outputed by an external executable) and show them on a text box. Because the logfile updates from time to time, I cannot simply do a while ((line = reader.ReadLine()) != null) . Any suggestions on how I can capture the changes in the log file? The assumption is that the log file will just keep appending text and never get deleted. Capturing the output will end when the external .exe ends (finishes running).
Please help.
Thanks!
~Rafferty
|
|
|
|
|
FileSystemWatcher may help.
Use FileSystemWatcher to watch for changes in a specified directory. You can watch for changes in files and subdirectories of the specified directory. You can create a component to watch files on a local computer, a network drive, or a remote computer.
|
|
|
|
|
I do something like that.
I keep track of the position of the last byte I read from the file.
On each cycle I:
open the file
seek to the last position
read to the end
save the new position
close the file
(This is done by a service that cycles every ten seconds and reads the log of a third-party application.)
You could also keep the file open:
open the file
while (someTest)
{
if ( filePosition < fileLength )
{
read to end
}
else
{
sleep
}
}
close the file
|
|
|
|
|
Interesting idea.
But isnt there some risk that, while your code reads the new data from
the tail of the file, the original program is unable to append to it ??
Luc Pattyn
|
|
|
|
|
Luc is right, I am getting an IOException when I open the log file using StreamReader because the external process is still appending to the log file. Any suggestions on how I can just read the file using read access which still allows other processes to write to it? I tried using FileStream but I just can't figure out how to use the Read(...) method, how do you convert byte[] to a string ?
Thank you for your help,
~Rafferty
|
|
|
|
|
Sorry, I actually meant the other risk, where the log producer might
be hampered by the log consumer doing its thing.
The log consumer can always react on an IOException and come back
later to retry, but the log producer (over which we may not have control)
should never be hampered by the log consumer(s) and I am not sure
that is the case in the proposed setup.
Luc Pattyn
|
|
|
|
|
oh.. yes that is the case, i do not have control on the log producer. Can you propose a solution on how i can read the log? Here is how I tried to do it but it stopped the log producer from executing (so I guess it was hampered as you just said).
<br />
using ( FileStream fileStream<br />
= new FileStream(e.FullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ) )<br />
{<br />
fileStream.Seek(_logFileLastReadPosition, SeekOrigin.Begin);<br />
TextReader reader = new StreamReader(fileStream);<br />
<br />
string line;<br />
while ( (line = reader.ReadLine()) != null )<br />
{<br />
PerformOutputAppended(this, new OutputEventArgs(line));<br />
_logFileLastReadPosition += line.Length;<br />
}<br />
<br />
reader.Close();<br />
fileStream.Close();<br />
}<br />
the code above is executed during a FileSystemWatcher Changed event, e.FullPath contains the full path of the log file. PerformOutputAppended(...) is the method which appends the string into the UI textbox.
I'm not sure if i'm doing things correctly as I am not familiar with these kind of behavior.
Thanks for your help,
~Rafferty
|
|
|
|
|
Hi Rafferty,
I don't have a general solution available, so I did some experiments.
I have one process that periodically (100msec) writes a string to a file;
my writer code reopens the file for every write access
(with a single open, a reader would be unable to access the file at all):
private void output(string s) {
try {
StreamWriter sw=new StreamWriter(fileSpec, true);
sw.WriteLine(s);
sw.Close();
} catch (Exception exc) {
timelog(exc.Message);
}
}
I have another process that periodically (but at a lower frequency, 1sec) tries
to read one or more lines; the code is similar to yours.
(assume seek is zero and delay is false):
private void input() {
try {
StreamReader sr=new StreamReader(fileSpec);
sr.BaseStream.Position=seek;
if (delay) Thread.Sleep(1000);
while((string s=sr.ReadLine())!=null) {
log("line "+line+": "+s);
seek=sr.BaseStream.Position;
}
sr.Close();
} catch (Exception exc) {
timelog(exc.Message);
}
}
This duo typically behaves well, I guess because the reader is simple enough
so it can do its job without a task reschedule, so the writer never is active
while the reader has file access.
But when I set delay true (reader keeping file accessed while relinquishing CPU), the writer starts to fail with "cannot access file", exactly as I was expecting.
I am still looking for a general solution; so far I would say the reader should
collect new data and avoid operations that take time or may relinquish the CPU.
But if the OS, for whatever reason, interrupts the input method and reactivates
the writer, things will go wrong there.
Luc Pattyn
|
|
|
|
|
Hello Luc,
Thank you so much for your help. I was able to figure out what to do, the code I posted above was almost correct, I just forgot to set my processStartInfo.RedirectStandardOutput to false . Here's some fixes to the code I posted above:
<br />
using ( FileStream fileStream<br />
= new FileStream(e.FullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) )
{<br />
fileStream.Seek(_logFileLastReadPosition, SeekOrigin.Begin);<br />
<br />
TextReader reader = new StreamReader(fileStream);<br />
<br />
string line;<br />
while ( (line = reader.ReadLine()) != null )<br />
{<br />
PerformOutputAppended(this, new OutputEventArgs(line));<br />
}<br />
<br />
_logFileLastReadPosition = fileStream.Seek(0, SeekOrigin.End);<br />
<br />
reader.Close();<br />
fileStream.Close();<br />
}<br />
Comments/suggestions greatly appreciated. But this is already serving my needs.
Thanks again Luc!
~Rafferty
|
|
|
|
|
hi all,
I am trying to develop an application that contains a navigator panel. the panel is supposed to have a small size of width only 7 on the loading process.
when the mouse comes over the panel wich is this thin layer of width 7 the panel should grow to be in its normal size.
and when the mouse leaves the panel the panel should shrink again to be of width 7.
It is working very fine (using the mouse enter and mouse leave events) but only when the panel is empty and does not contin any button.
but when i fill it with buttons it is not working at all.
I think it is because when the button is added to the panel it takes part of the visible part of the panel so it will not through the events of mouse enter.
I tried to make the buttons' visible property to false when the panel is in the shrinking mode but this didn't give any result to.
i tried to work on the mouse enter and mouse leave events of the buttons and this didn't work too.
did anybody face a problem like this before.
if so plz give me a solution.
i will keep trying to work it out.
if i find the solution before u i will tell u about it.
thanks in advance,
|
|
|
|
|
Hi friends,
I have a panel in the MDI form and there are some controls in the panel .When I open MDIChild forms ,the forms go behind the panel.
I tried forms.BringtoFront()and panel.SendtoBack().But nothing works.
Then I set setchildIndex of panel to 0 but ,no improvement.
Is there any way to keep the panel always behind all the forms ?
If anybody can help me on this,please..
Thanks
|
|
|
|
|
Hello,
I think that not. The MDIChilds will ever go behind the panel. There are two ways of solving this:
- Docking the panel of the MDIParent on top(for example, if is smaller than the main form).
- Showing off the panel of the parent when MDIChilds are added(if the size is the same that the form).
|
|
|
|
|
I tried out your suggestions.I docked the panel on top of MDIForm,but then the child form started coming under the panel where I require it to come above the panel.
Sorry I didn't understand your second suggestion.If you intented to say to apply panel.show().It's always on that mode it does appear.I want child form.Show() happen effectively.
|
|
|
|
|
i have to do free from select operation in ms paint..can any one give an idea..
I did drawing the rectangle by taking maximum point and minimum point after that how to fill regions ..and how to get the path...
ravi
|
|
|
|
|
Hi all,
Can anyone tell me how to implement Voice Chat in C# .Net??
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
|
wrote: None
What do you want help with? You'll have to supply more information than "none".
|
|
|
|
|
|
I want to display 3 images in a single row of propertygrid.
Ex: Fruit - > |Image1 |Image2 |Image3 |
Hw can i display like that..
|
|
|
|
|
I have some questions about displaying jpeg 2000 files in C#.NET. It means I have a binary file which is in JPEG 2000 format. I want to display it in a picture box. Does C#.NET support it or not? Is any conversion needed?
Thanks in advance.
|
|
|
|