|
Hi!
In one of my base classes, I have a function which receive a callback from another application. In this function, I would like to access Excel.Application object but I receive an exception: QueryInterface for interface Excel._Application failed.
If my class were inherited from Windows.Forms, I could use BeginInvoke function. So I would like to know a way to access Excel.Application object in my callback function.
Build with C# for Excel Object 9.0 (Excel 2000)
Thanks in advance!
|
|
|
|
|
Can you point me to a book or article that explains how to create tabbed forms?
Thank you
P.S.
What is the equivelent of BeginWaitCursor()?
|
|
|
|
|
i am not sure about any tabbed form articles, youll have to search.. but they are built into windows.forms.. they are listed in your toolbox as 'TabControl'.. you should be able to use it pretty easy..
and here is the cursor question
Cursor.Current = Cursors.WaitCursor;
Cursor.Current = Cursors.Default
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Will I do not know of an article on the topic, it is very easy to do in Visual Studio.
Place a TabControl on your blank form. Right click on it and select New Tab. Now start placing controls on that tab. At any time, right click the tab control and select Add Tab to make more tabs. You can switch between the tabs while in the designer.
Rocky Moore <><
|
|
|
|
|
That was just too easy. Thanks!
|
|
|
|
|
I have an integer representing a month, what is the best way to convert it into the full month name?
thanks
U.M.
It ain't what you know that matters.
Uncle Monkey
|
|
|
|
|
I don't really know if there is a built-in function (I looked in System.DateTime but didn't see one) so I threw this one together:
private string MonthName(int iMonth)<br />
{<br />
string[] sMonths = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };<br />
return sMonths[iMonth] ;<br />
}
|
|
|
|
|
thanks for that GISnet.
I didn't see one either and wondered if I'd missed something really obvious and was being stoopid
It ain't what you know that matters.
U.M.
|
|
|
|
|
System.Globalization.DateTimeFormatInfo.MonthNames
|
|
|
|
|
Ok now I feel .
|
|
|
|
|
Here is my contribution:
public enum Months
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
[STAThread]
static void Main(string[] args)
{
for (Months month = Months.January; month <= Months.December; month++)
Console.WriteLine ("{0} - {1}", (int)month, month.ToString ());
}
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
Jim Stewart wrote:
Here is my contribution:
This has no international support...
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
I respectfully submit that the problem description did not indicate the need for internationalization. Therefore my modest contribution met the initial requirements.
Since the bar has been raised, I will attempt to satisfy.
One solution might go thus:
public enum Mois
{
Janvier = 1,
Février,
Mars,
Avril,
Peut,
Juin,
Juillet,
Août,
Septembre,
Octobre,
Novembre,
Décembre
};
[STAThread]
static void Main(string[] args)
{
for (Mois mois = Mois.Janvier; mois <= Mois.Décembre; mois++)
{
Console.WriteLine (mois.ToString ());
}
}
I suspect that this is not what was intended. So to blend my previous solution with Monsieur Nischalke:
public enum Months
{
January,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
[STAThread]
static void Main(string[] args)
{
DateTimeFormatInfo dtfi = new DateTimeFormatInfo ();
for (Months month = Months.January; month <= Months.December; month++)
{
Console.WriteLine (dtfi.MonthNames[(int)month]);
}
}
This has the benefit of symbolic constants instead of literals with the internationalization.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
Since the gauntlet of challenge has been thrown.
<br />
using System.Globalization;<br />
<br />
CultureInfo ci = new CultureInfo("fr-FR", true);<br />
DateTimeFormatInfo di = ci.DateTimeFormat;<br />
<br />
foreach(string strMonth in di.MonthNames)<br />
Console.WriteLine(strMonth);<br />
<br />
|
|
|
|
|
May I ask how one gets the month name from an integer in this scenario?
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
DateTimeFormatInfo.MonthNames
Gets or sets a one-dimensional array of type String containing the culture-specific full names of the months.
|
|
|
|
|
Touche - I was getting a bit punchy last night.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
Hi all:
I'm a total newbie to C#, but would like to know if there is a freeware implementation of the zip component for data compression.
I have used a similar component in C++ for years but have not seen a similar implementation for C#.
TIA,
Martin.
---
Regards,
Martin.
|
|
|
|
|
|
Thanks James, just what the doctor ordered )
---
Regards,
Martin.
|
|
|
|
|
hello,
i want to know what is
c# equivalent of delay() in c/c++
LOOKING FOR HELP
ASIM
Asim
|
|
|
|
|
|
C# Code:
<font color="blue">private</font> <font color="blue">void</font> button2_Click(<font color="blue">object</font> sender, System.EventArgs e) <br> { <br> MessageBox.Show("Do some stuff!"); <br> <br> System.Threading.Thread.Sleep(5000); <font color="DarkGreen">
hope that helps.
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
i don't think there is any sleep() method in c#
?
ASIM
Asim
|
|
|
|
|
yes it's System.Threading.Thread.Sleep , like posted above.
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|