|
Console.Writeline() then
Console.Readline() then user does not need to press enter
|
|
|
|
|
Use Console.ReadLine();
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
This is my code below..the problem ofcourse progress bar once started works fine..after browsing thru other forms and returning back to this form only repaints it when progress bar functionality is complete.
private void button2_Click(object sender, EventArgs e)
{
demothread = new Thread(new ThreadStart(ProgSafe));
demothread.Start();
}
private void ProgSafe()
{
if (this.progressBar1 .InvokeRequired )
{
SetProgCall del = new SetProgCall(ProgSafe); //SetProgCall is a delegate.
this.Invoke(del);
}
else
{
Progress();
}
}
public void Progress()
{
for (int i = 0; i < 100; i++)
{
Thread.Sleep(200);
this.progressBar1.Value = i;
// Application.DoEvents(); It is fantastic when using tis statement but not good programming..so is there other way out....(backgroundworker is good )
}
}
|
|
|
|
|
This way it doesn't make much sense. You are starting a thread which calls Progress in the GUI thread (which will block all repainting because of the Thread.Sleep).
It should more look like the following:
private void button2_Click(object sender, EventArgs e)
{
demothread = new Thread(new ThreadStart(ProgSafe));
demothread.Start();
}
private void ProgSafe()
{
for (int i = 0; i < 100; i++)
{
Thread.Sleep(200);
if (this.progressBar1.InvokeRequired)
this.Invoke(new SetProgCall(IncreaseProgress));
else
IncreaseProgress();
}
}
private void IncreaseProgress()
{
this.progressBar1.Value += 1;
}
Now the whole work is done in the thread and just the update of the progress bar is delegated to the GUI thread.
|
|
|
|
|
Hi!
I have a form with a ListView. When the user dbl clicks a row in the listview, a new window with data regarding this row pops up. I want to prevent the user from being able to open more than one window like this at a time.
A nice solution would be to replace the already opened window should the user try and open a second. How would I go about doing this? I'm kind of new working with winforms...
/regards
|
|
|
|
|
Hi Friend,
Instead of using Form.show() method use Form.showDialouge() method,
It will show your form as a dialouge box and without any action on it
no one can open other form.
This may solve ur problem.
Enjoy
Naveed Kamboh
-- modified at 7:36 Monday 24th April, 2006
|
|
|
|
|
thanks for the tip! Though not applicable in my particular case as it's not up to me which method to use, it's good to know for future use.
|
|
|
|
|
one option can be to make the new window a modal dialog...but in that case you'll be able to access the listbox only when the new dialog is closed...
if you don't want that you can disable the listbox before the new window opens (after the user selects to open the window)...and then you can enable it again when the user closes the window...
there should be some more ways to do it...
|
|
|
|
|
Hi.,I have a problem with detect the exact cd drive and usb drive to get the contents from my application, i am using c# for coding.
|
|
|
|
|
can anybody tell me how to pass a string arrays from javascript function which is on clientside to server side c# function
and vice-versa
how to call a function in javascript of clientside from serverside c# function and viceversa
|
|
|
|
|
Pass it in Javascript and call that Javascript in Server Side
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
is possible to use mouse to navigate between the menus in console applications if yes please tell me how
Thank you in Advance
sunny
|
|
|
|
|
No - a console app does not have a message loop to process messages from the mouse.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi All
listview can have Datasource ?
|
|
|
|
|
Do u mean can we bound it to data source?
Naveed Kamboh
|
|
|
|
|
It does not have it... it uses a datasource.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have the need to add a phantom "All Selections" item to a databound combo box, but inserting a new item into the data binding source results in source collection also having the "All Selections" item throughout the entire project, which is not desired.
So what's the best practice way of inserting a phantom item into a data bound combo box, so it doesn't mess up the underlying data source?
|
|
|
|
|
You can create a class which wraps the actual data source, and exposes an augmented version of the data source with the extra item(s) in the list. Then bind the ComboBox to an instance of the wrapper class.
Josh
|
|
|
|
|
hi every body
i want to Create new user, Edit, reset Passsword in Active Directory By LDAP
some body give me an example
thanks
AnhTin
|
|
|
|
|
Hi All.
I need Enable tabpage in tabcontrol.can you help me ,please?
-- modified at 23:35 Sunday 23rd April, 2006
|
|
|
|
|
I can only guess what you mean my enabled:
tabControl.SelectedIndex = 3;
|
|
|
|
|
U can disbale /enable entire tab
If u want to disable specific tab u can make it as invisible/visible
uwtPROStandradVendor.Tabs[0].Visible = false;
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hi everybody
Im working in an aplication, and i need to show reports from a database in access, those reports must be made using crystal reports, in vs.net. When i make a report with crystal reports, i configure the location of the database, but if i need to move the aplication to another pc, how i can change the location of the database to the report, i need to know if there are something like:
MyReport.DatabaseLocation=textBox1.Text;
|
|
|
|
|
Hi,
I have textboxes that are Databinding to a DataTable.
I save the values of the textboxes to an Access db.
I have a textbox that is bound with a db column that is a Long Integer.
If I change the number in the textbox to a new number, and update it works ok. If I clear the number in the textbox in the hopes to set the field to DBNull, then the textbox reverts back to the original bound value.
I'm not able to:
if (txb_Number.Text == "")
{
//this never occurs because the textbox reverts to the original bound Long Integer value
code to update db with a DBNull value
}
I can only change the bound data if a new number is used. A blank textbox (or letters entered) only reverts back to the origninal value. I want to update the field to DBNull if the textbox is empty.
Ron
|
|
|
|
|
I have two items in ComboBox collection.For example Graph 1 and Graph 2.For each of them using ZedGraphControl I plot a graph.How can I change the graph by chosing each element?
|
|
|
|