|
Hi all,
1) For one of the columns in my datagrid, I want the header text to be "Hourly Rate". I want "Hourly" displayed on top with "Rate" underneath it. How can I do this in C#?
2) How can I align the header text of a column to be center while the data is aligned as left?
I can align the entire column (affecting both Data and header) only.
Please help
THanks.........
|
|
|
|
|
First of all, I'm using the .NET COMPACT Framework. I have a message box, with yes and no buttons. When a user clicks yes, a large amount of logic is executed (databases are queried, xml is parsed, docs are printed, etc). All of this logic takes about 10 seconds to complete, but the confirmation dialog just hangs there with the yes button depressed until a "success" message box is displayed. My boss doesn't like the way this looks, because the program appears to be "frozen". I would like to have the confirmation box disappear after the user presses yes - is this only possible if i bring up something else (i.e. a progress bar)? Also, is it possible to have a progress bar in a messagebox?
Here is the code I'm using for the confirmation box:
if(MessageBox.Show("Backflush Pallet "+pallet+"?","Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
{
...execute tons of logic...
}
Thanks,
j1e1g1
|
|
|
|
|
Hmm...this is slightly tricky since that dialog isn't controled by you and therefore can't do self contained logic on how to appear/disappear. I'm not familiar with how the Compact Framework behaves but it might be solved if you let the message pump work. What might be going on is that the message "close dialog" is in the message queue but isn't being done because of the "execute tons of logic" bit.
I'm not sure how long of a fishing excirse you want to go on but one thing you can try is putting the "execute tons of logic" in another thread and let the message pump work in the primary UI thread. I'm not sure if this will work because as I said I am not sure how the Compact Framework behaves with threaded behavior let alone how the UI functions in subtle behaviors like this.
|
|
|
|
|
Wack in a call do Application.DoEvents() just before the "tons of logic" and the message box will disappear.
|
|
|
|
|
The simplest method would be to break the
MessageBox.Show call out of the if block.
DialogResult dr;
dr = MessageBox.Show(yadda, yadda)
if(dr == whatever) {
.. do tons of whatever stuff
}
|
|
|
|
|
HI~
I use a listview(large icon) of compact framework. After I click a item, it launches to another form with large icon listview.
However, after I launch to another form, all the icons of the previous form in the were disappeared.
How can I solve it?
Thanks
|
|
|
|
|
|
Hi there,
I'm using CDO to access Exchange folders in a C# application.
Is there a way to filter the Task and/or Appointment items in a public folder for start date and due date?
Filtering for a specifig start date and end date is easy, but I need to find all Task items that begin after date X and end before date Y.
Is this possible?
Thanks for every hint,
coco
|
|
|
|
|
Hi, guys, how can I display a progress(eg. just like open a web page progress in IE6.0) in the statusbar.
Thank you every much
vigorous
|
|
|
|
|
Go to MSDN and look up the StatusBar class and the ProgressBar class. StatusBar has a Panel where you can add panels. If you don't like monkeying with code use the designer add panels then add ProgressBar to the panel.
|
|
|
|
|
http://discuss.develop.com/archives/wa.exe?A2=ind0110D&L=DOTNET&D=0&P=6846
Shows you how
Gary
"A fellow with the inventiveness of Albert Einstein but with the attention span of Daffy Duck."
Tom Shales talking about Robin Williams
|
|
|
|
|
|
Hello all!
Is there any way to simulate the mouse on the way you normally use it?
I read that with the Message class you can set the mouse's position in certain window (or in all at the same time(???)), but can you set the mouse's position in WinXP like you normally moving the mouse? So you don't set to which window you want to send the mouseposition, just moving it and clicking like when you use it, and an application will have the control when you clicked on its window or something (like when you just use the mouse with your hands).
So like instead of a window you send it directly to the operation system or something?
MS Visual Studio.NET 2003
C#
|
|
|
|
|
|
Damn I almost started a new thread in ASP.NET
Just before typed the message thought first i'd ask you why(i couldn't understand how the hack it can be), but now I see your subject is answer to a completely different question. How come it posted to my thread?
MS Visual Studio.NET 2003
C#
|
|
|
|
|
There was a goof up with the forums when I was posting, not sure exactly what happened but I noticed it as well.
- Nick Parker My Blog | My Articles
|
|
|
|
|
I have a ListBox control on my form which has the following properties set:
MultiColumn = false;<br />
SelectionMode = = SelectionMode.One;<br />
Sorted = false;
and I load the data as such:
DataSource = dt;<br />
DisplayMember = "CASE_NAME";<br />
ValueMember = "CASE_NAME";
All is fine, the ListBox displays the data just fine, with one problem. Before the user has selected any of the items in the ListBox the first item is highlighted as if the user has already selected it. Is there any way to show the initial display of the items in the ListBox without ANY of the items being highlighted?
|
|
|
|
|
After binding it to the DataSource, set the SelectedIndex of the ListBox to -1
|
|
|
|
|
Thanks, but that doesn't work!
|
|
|
|
|
Hi
Did u set the SelectedIndex after binding the ListBox with the DataSet.
It is working for me. I am doing it after filling the DataSet which the DataSource for the ListBox like this.
private void Form1_Load(object sender, System.EventArgs e)
{
this.oleDbDataAdapter1.Fill(this.dataSet11);
this.listBox1.SelectedIndex = -1;
}
|
|
|
|
|
I had filled my DataTable dt in a lower tier, and then bound the ListBox control from a call in the forms contructor, after all the controls have been instantiated. After I have bound my DataTable to the ListBox I have then set the ListBox SelectedIndex property to -1, but I still get the first item of the ListBox displayed as highlighted. I don't have any other code that would have selected an item in the ListBox.
Forgive me, but you appear to have a oleDbDataAdapter1 and dataSet11 on your form which you have bound to the listbox1 at design time, else the listbox1 doesn't appear to be bound to the dataSet11.
|
|
|
|
|
Yeah,
For me also happening the same thing. I dont know why. But this workaround will solve your problem. You have to add an EventHandler for Form's Activated event and you have to add the following code in that EventHandler method.
private void Form1_Activated(object sender, System.EventArgs e)<br />
{<br />
this.listBox1.SelectedIndex = -1;<br />
this.listBox1.Invalidate();<br />
}
|
|
|
|
|
i have created 2 datagrids. The upper one displays the currently available values and the lower one allows entering new avalues... When u enter a vale to the lower grid and click on a button(Add) the selected value
(s) should be added. If one entered a valid row and another row with missing fields only the valid row should be added and the invalid row should be remained (displayed).How can I achive this?.
samitha
|
|
|
|
|
Get the row index of the row that is valid and use
DataTable.Rows.RemoveAt(rowIndex);
For each row that is valid, this will remove the row from the table the datagrid is bound to and therefore remove it from the datagrid itself.
Kev Pearman MCP
|
|
|
|
|
how can i reverse-engineered from IL?
How can I stop my code being reverse-engineered from IL?
is there any tools for this ?
********************
S r e e j i t h N a i r
Bangalore - India
********************
|
|
|
|