|
|
When I run the following code on Vista, it updates the label1.Text on the form with each value in textBox1.Text on every "while" loop. This is how I want it to work.
However, when I run the same code on XP, it waits until the "while" loop is complete then only updates label1.Text with the last value in textBox1.Text. Until then, it stays blank.
Is there a way to make it work on XP the same way it works on Vista?
Thanks!
StringReader text = new StringReader(textBox1.Text);
string line;
while ((line = text.ReadLine()) != null)
{
string cmdline = "c:\\windows\\*.* /y /c /i c:\\temp\\windows_backup";
ProcessStartInfo psi = new ProcessStartInfo(@"xcopy.exe", cmdline);
psi.WindowStyle = ProcessWindowStyle.Hidden;
Process p = Process.Start(psi);
p.WaitForExit();
label1.Text = line;
}
}
|
|
|
|
|
Well, your code appears to wait for the process to exit before updating the textbox. Try moving that line label1.Text = line; to the top of the loop. (I'm surprised it works in Vista as it is right now.)
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks John. I want the update to happen only after the process exits, so that's fine. The process does indeed exit so I'm not sure why you think it wouldn't work.
|
|
|
|
|
You could call Application.DoEvents() after setting the new text to force an update of the textbox. While I don't like this solution it should still work.
Like John, I'm a bit surprised that it updates on Vista after all with this code.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks Greeg, I'll give that a shot and let you know if it works.
|
|
|
|
|
Hey Greeeg, Application.DoEvents() worked!!!
You're great.
And, thanks John for responding so quickly. I did try your suggestion prior to my post and it didn't make a difference.
Thanks again guys!
--Clark
|
|
|
|
|
Well... i not find any infos about how to make a GET request using a http proxy (using sockets and not the .net library).
I go to repeat USING SOCKETs and NOT the HttpWebRequest...
Thanks in advance.
|
|
|
|
|
Hello Sir,
Please help me ?
I am createing a custom combo box control in c#.net 3.0 by inherit combo box. in this control i am using OnPaint and OnPaintBackground to paint combo button .
The problem came when paint event fire's, it Black the inner combo box color(is this is nonclient area?).and not show back color in combo's inner area.
and here dropdownstyle=dropdown.
But when i set dropdownstyle=dropdownlist then it will fine. now the problem with this is it will not show the text in combox after drop down list is closed.
Now couldn't find the way how proceds further.
Thanks.
|
|
|
|
|
Hi,
I've worked on OLE DB templates like DEFINE_COMMAND_EX, BEGIN_PARAM_MAP etc. in VC++. Now I need to convert that functionality into C#. I'm new to C#. So please tell me whether C# is having the similar sort of templates.
Following is an example in VC++ using OLE DB templates
class CGetDetails
{
public:
LONG m_CompanyId;
BEGIN_COLUMN_MAP(CGetDetails)
COLUMN_ENTRY(1, m_CompanyId)
COLUMN_ENTRY(2, m_CompanyName)
END_COLUMN_MAP()
DEFINE_COMMAND_EX(CGetDetails, _T(" SELECT * from companylist"))
BEGIN_PARAM_MAP(CGetDetails)
END_PARAM_MAP()
void ClearRecord()
{
memset(this, 0, sizeof(*this));
}
};
Now I need similar sort of class in C#. Could you please tell me the related possibilities?
Thanks in advance,
Malleswari.
|
|
|
|
|
Try here[^]
only two letters away from being an asset
|
|
|
|
|
hi , i would like to get the drivers of hard disk
but i dont know how can i achive this
thanks for help
MD_NADA
|
|
|
|
|
Erm not sure what this post is about but try getting the make and model of your hdd and downloading them?!?!
At university studying Software Engineering - if i say this line to girls i find they won't talk to me
Dan
|
|
|
|
|
Perhaps WMI[^] has what you need? I've never needed this information but it would be the first thing I'd try.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Have you tried the website of the manufacturer?
|
|
|
|
|
hi All,
I am Currently Working on Wpf And WinForms using SCSF. Any one can please help me in this ,how to Develop The Themes Concept in Wpf or Win application .If any one knows Articles please FWD the Links it helps lot.
Thanks And Regards,
Guru
|
|
|
|
|
Please - pick a forum and stick with it.
|
|
|
|
|
how to display X axis values on top of graph while the y axis displayed top to bottom values?
|
|
|
|
|
You may want to ask this question at the original ZedGraph[^] site.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi to all,
In windows forms application, I have simple button and one ContextMenuStrip. I set, then, ContextMemuStrip property of the button to that particular ContextMenuStrip.
When I right-click on my button during program executions, nothing happens.
How to make CMS to pop-up when I click the button?
|
|
|
|
|
If your ContextMenuStrip doesn't have any items it will not show.
To get it to pop-up when clicking (left click..?) you can do the following :
private void button1_Click(object sender, EventArgs e)
{
contextMenuStrip1.Show(Cursor.Position.X, Cursor.Position.Y);
}
A dogged, arrogant belief in self and the childlike idealism that comes with not knowing my limits. This is my greatest blessing, my priceless attribute.
|
|
|
|
|
hello friends,
i already posted my query but still need some more assistance to clear my doubt,
am having a text box to get email address and a combo box to select its category
for e.g
category might be as IT Dept, Mech Dept and so,
at the first form am inserting these to in to a table.
in another form i have only the combo box which has loaded with the category data.
when i select any category i need all the emails belongs to this category should come with a .csv file..
am stuck in " how to seperate emailid's as per the category and how to bundle it and make a .csv file at run time ... ?Confused
self confidence+hard work=SUCCESS
|
|
|
|
|
Hi Lee,
I think you have to pass category Id in the DB and get all the emailid regarding that category.Like you have selected category "IT Dept" and its id is 2(CategoryId) then pass it to DB and collect result in DataTable
select email from tablename where categoryid = 2
Now you have all the email id in the DataTable.
I hope you can now export this data to the .csv file
Hope this will help you.
Regards
|
|
|
|
|
Hi
As you know a csv[^] file is a text box with coma separated values in it, so all you have to do is to get your data from database, join values of each row separated with a coma into a string and insert the string to a text file and save it.
|
|
|
|
|
Hi,
Is it possible to get the SQL provider list in the code (C#)?
something like using namespace ...
Regards
|
|
|
|