|
Just power down the computer and walk away
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
> ...
&who: ...
&message: "incorrect usage of auxiliary keyword"
&syntax: ...
&trace: #<syntax ...>
|
|
|
|
|
Hi All,
I have an application which displays the fonts in "Segoe UI".
But if I run the same application on another OS on which the font is not available.
It is displaying the font in "Microsoft Sans Serif".
Is there any way to change the default font to "Tahoma" on those machines ?
Thanks in Advance.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
You can explicitly set the font on each form so that it will use that font on all operating systems, if available. However, leaving the font settings as is will cause the application to display using the default font for that operating system, which is generally what you want.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Hi,
i am developing an application in C# 2.0 which uses BHO and multi threading. i am getting following error:
"Context 0x15da88' is disconnected. Releasing the interfaces from the current context (context 0x15d860).This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the applicationis completely done with the RuntimeCallableWrappers that represent COM components that live inside them."
can any body tell me whats the reson for this error and how can i resolve it? VS dosnt tell me the original location of error, so i am helpless and dont know from where to start debugging. any kind of help is appriciated. Thanks,
Regard,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Hi,
I ve written a code something like below in Click event of Button btnWindows:
...
...
btnWindows.Enabled = false;
MessageBox.Show("Good Morning!");
for (int i = 1; i <= 500000; i++)
{
for(int j =1; j <= 500;j++)
{
}
}
btnWindows.Enabled = true;
...
...
in above code, instead of inner For loop i ve some calculation that takes about 6 to 7 seconds to finish.
The problem is,
when button gets disabled and message box comes
after that when i click on disabled button ( Or, access it through its Hot Key ) the click event gets fired again and i m wished "Good Morning!".
Waiting for some helpful answers !!
|
|
|
|
|
You have everything in one segment of code. If the code is in the click event of the button then "Good Morning" should always show. Keep in mind that you are enabling the same button after the for-loops that you disables before the for-loop. The button will only be disabled for the [milli]seconds until the for-loops are complete.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Thanx Thomas,
But then how can i avoid the further click events of the button.
In this case the for-loop takes about 6 to 7 seconds to finish
and if in between the user click the button the process starts again
after finishing once.
(if i put one more message box after the for-loop then the click doesnt fire again,
but i dont want to go that way)
Regards,
SIFAR.
|
|
|
|
|
Is there a delay in your enabled property changing?
Immediatley after you disable it but before the MessageBox, try btnWindows.Refresh();
Dave
|
|
|
|
|
What I would suggest is having a boolean variable for the class.
Pseudocode:
bool tmpCanContinue=true;
public void Button_Click(Object sender, EventArgs e)
{
if(tmpCanContinue)
{
tmpCanContinue=false;
...work with the for-loops
tmpCanContinue=true;
}
}
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Part of the problem may be that you won't get to the for loops until you clear the MessageBox.
|
|
|
|
|
hi
I want change fild of database order by fild of datagrideview.
|
|
|
|
|
can u elaborate more???
do u want to insert changes been made in the datagridview directly to the data base???
Have Fun
Never forget it
|
|
|
|
|
I have a class which loads it own values at startup from a database. I've abridged the following a little, but given the following:
public class AppSettings
{
int notNestedType;
public class _nestedClass
{
int nestedType;
}
_nestedClass nested = new _nestedClass();
protected void Load()
{
MemberInfo[] MemberList = me.GetMembers(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
foreach (MemberInfo mi in MemberList)
{
if (mi.MemberType == MemberTypes.Field)
{
fld.SetValue(this, someValue);
}
else if (me.MemberType == MemberTypes.NestedType)
{
}
}
}
}
Setting values on this .notNestedType is not a problem.
The problem is setting values on this .instance.nestedType as I have an instance of this but don't know how to find the instance of nestedType .
I'd be very grateful for any pointers as I've spent hours searching google and trying to come up with a solution.
Thanks,
Mark.
|
|
|
|
|
i did 2 forms at Visual Studio 2008 in C#.
i want to save Number from the first form and to use it in another..
how can i create a Global variable?( that all forms have access to it.
for example:
int Num=3
i want that Form1 and Form2 will can change "Num".
|
|
|
|
|
global variables are poor design. try the singleton pattern instead, or better yet if you're using this as a parameter alone and not part of a class structure put it into a settings file and you'll have the parameter application wide.
Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|
|
you can use the static or shared keyword depending on the language that you are using.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
how to call matlab command from c#? such as figure; plot
thanks.
|
|
|
|
|
I'm learning C# as part of my education and the hosting company where i work was nice enough to let me program automatic provisioning of sites and user, so i turned to the provisioning sample obtained on iis.net and adapting it and adding to it to make it work the way i want.
I'm creating it as a service as it makes it more manageable remotely. The thing is, im having a problem with quota control. When i add disk quota to a user it works fine but when i want to edit it or delete it, it doesn't work the way its supposed to. This problem only occurs when a user with the same name has previously been created and deleted. It seems like that when trying to i.e. edit the quota of the user, it actually edits the quota of the previous, deleted user. Hence a new quota entry is created which references to the SSID of the old, deleted user, not the current that it is supposed to use. This problem only occurs if the user is deleted by the service. If i delete the user (and folder, site, app pool and quota, as the service does) manually it works fine the next time a user is created with the same name.
I hope the above description makes sence. Anybody have any idea what goes wrong and how to fix it?
Thanks in advance.
I haven't lost 'till I'm the last one to cross the finishline.
|
|
|
|
|
I can convert a long using Convert.ToString(number, 2) but Convert.ToString(value, toBase) doesn't exist for ushort, uint, or ulong.
For Hex I use ulong.ToString("X") but I can't find a binary equivalent.
Dave
|
|
|
|
|
Hi,
the official names for the integer types are Int64, Int32, Int16, UInt64, etc.
So Convert.ToString() has what you need.
ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/fxref_mscorlib/html/0d16714f-b4f2-7157-b56d-b9b321ffa339.htm
|
|
|
|
|
The Convert.ToString() overloads for ulong/UInt64 and any of the other unsigned types only have (value, IFormatProvider provider) not (value, int toBase). The signed varieties do however.
Dave
|
|
|
|
|
There's probably a nicer way (and a .NET built in one), but this will also do the job:
static string UlongToString(ulong value)
{
int ulongsize = sizeof(ulong) * 8;
StringBuilder ret = new StringBuilder(ulongsize);
for (int i = 0; i < ulongsize; i++)
{
ret.Insert(0, value & 0x1);
value >>= 1;
}
return ret.ToString();
}
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Cool! Thanks for that
I need to trimthe leading zeros (if any) now, but I should be able to figure that out.
Thanks again.
Dave
|
|
|
|