|
|
Thanks for ur command
but i m using Excel COM Object for reading excel data
so i need solution for rpc server unavailable using Excel dll
Thanks
Sak
|
|
|
|
|
How do I declare a queue of string arrays?
Queue<string[]> qVar = new Queue<???>;
|
|
|
|
|
you almost did that just here is the complete one
Queue<string[]> qString = new Queue<string[]>();
good luck
|
|
|
|
|
Ahh, I was trying Queue<string[]> but forgot the () after the fact.
Thanks!
|
|
|
|
|
Hi,
DataGridView gives only primary sort (by one column).
How can i define a secondary sort in a bound data GridView?
(I saw a solution for unbound data only)
Thanks
dana Tov
|
|
|
|
|
I have the following problem
-I created a form with an tab control
-I the tab control contains (minimum) 2 tab pages
-In the second (non selected) tab page i have a control
-And there is another formular (irrelevant content)
<br />
#region PREPERATION<br />
Form f = new Form();<br />
TabControl t = new TabControl();<br />
<br />
TabPage tp1 = new TabPage("page1");<br />
TabPage tp2 = new TabPage("page2");<br />
<br />
Button b = new Button();<br />
b.Size = new Size(100, 20);<br />
<br />
tp2.Controls.Add(b);<br />
<br />
t.TabPages.Add(tp1);<br />
t.TabPages.Add(tp2);<br />
<br />
this.Controls.Add(t);<br />
t.BringToFront();<br />
#endregion PREPERATION<br />
When i first open the child-form with Show() and then select the tab page with the control the parent-form is focused again.
f.Show();<br />
t.SelectedIndex = 1;
How can i force the child-form to keep its focus, while the parent change the tab page?
I don't want to use ShowDialog() or Show(this).
Is this a bug or a feature of the tab control (tab page)?
(Is the only way to fix it, changing the order of the source code?)
|
|
|
|
|
Try tp2.Select(); You don't want to select the tab control, but the actual tab with the control on it.
Hogan
|
|
|
|
|
It does not work.
It don't show the tab page (tp2).
|
|
|
|
|
Does anyone have another idea?
|
|
|
|
|
Hi
Can anyone tell me how to generate a date in random in the interval of two dates (Max date and the Min date)...
Please anyone suggest the answer soon as my due date is nearing
Thx
Anjum
|
|
|
|
|
search on google for "c# random" it'll tell you about the random class ... the random class takes a min int and a max int ... the rest you just need to code.
|
|
|
|
|
I think you can do that with Random Class and DateTime Struct
you can get number of available days in each month with DateTime.DaysInMonth method for correct random date generating and then simply put your generated random numbers from random class in the Constructor of DateTime struct and you will have it.
|
|
|
|
|
1) Calculate the number of days between MIN & MAX.
2) Get random number within that range.
3) Add the random number to MIN.
TimeSpan ts = DateTime.Parse("12/31/2006") - DateTime.Parse("1/1/2006");
Random r = new Random();
int randomDays = r.Next(ts.Days + 1);
DateTime randomDate = DateTime.Parse("1/1/2006").AddDays(randomDays);
MessageBox.Show(randomDate.ToShortDateString());
|
|
|
|
|
It means that when user press F1, help of the application will load in a special form. How can I do this?
Pls help!
|
|
|
|
|
Hi
You just use c# namespace
using System.Runtime.InteropServices;
Process.Start("Test.Chm")
so you can call anykind file using the above code and also connect to internet use these code
Sak
|
|
|
|
|
Thanks Sak,
What is the Process is?
|
|
|
|
|
See System.Windows.Forms.Help.ShowHelp
|
|
|
|
|
Hi All,
I have a smart part views which is calling a user control named "A". I want to call a another user control named "B" from previously loaded user control "A". Is that possible or otherwise i have to change the user control "A" to a smart view.
Please anyone help me in this, if possible with a sample code...
Thanks in advance,
Uma Shanker.K
|
|
|
|
|
when i double click in listview i want to do something i have 4 item i listview
but how i get item line 1 is id? line2 id? but idont know to use method
if (listview1.???????? = =1) { do somthing }
srry i begin
|
|
|
|
|
you can use listView.Items[...] property generally
in double click
and ListView.SelectedItems[...] Property or List.View.SelectedIndices[...] which the first one returns the selected ListViewItem and another one returns the index of the selected ListViewItem
and if you do not use multi selection you can simply access to the selected Item like
ListView.SelectedItem[0]
<br />
<br />
void listView1_DoubleClick(object sender, EventArgs e)<br />
{<br />
MessageBox.Show((sender as ListView).SelectedItems[0].Text);<br />
}<br />
good luck
|
|
|
|
|
|
can you give some hints about what exactly you mean about id?
Using the ListBox is very similar except it has too more ListBox.SelectedItem and ListBox.SelectedIndex Properties and another difference is it will return an object which must be casted to what you put inside for using it after retrieving from the list
and about showing things in ListBox
when you add something in listbox it simply use your object's ToString method for showing that in the list So all things you want to show from your class in the listBox must be set into overridden version of ToString method so it can show that.
Hope this one helps
|
|
|
|
|
As title really, i have an app with the ability to drag an item from a list box onto another grid type control, i can drag and drop no problem, i can also get the x,y coords of the mouse within the control when not dragging, but i need to get them when i have dropped the item onto the grid control. the problem is, the coords i am getting are not the withing the control but the screen ( i think ) any ideas how i can covert to the controls coords or how to get the coords from the control ??
Thanks in advance
Lee
|
|
|
|
|
hi
Point point = MyControl.ScreenToPoint(new Point(e.X, e.Y));
regards
|
|
|
|