|
What do you mean by "locked this form"??
|
|
|
|
|
Simply content of Form not appers (as kind of infinite loop as I'm showing on link for image above).
|
|
|
|
|
I can't see your link as that site is blocked where I am.
If you're saying that your form is completely blank, it's because your continuously looping code is running on the UI (startup) thread, constantly hogging the thread so it's can't respond to WM_PAINT messages coming from Windows.
You have to redesign your application so that this long running code is put in a background thread, freeing up the UI thread to do, well, UI stuff.
|
|
|
|
|
publicstructtest
{
[FieldOffset(160)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
publicint[] DC;
[FieldOffset(168)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
publicfloat[] IN;
[FieldOffset(176)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
publicbyte[,] us;
}
privatevoidbutton1_Click(objectsender, EventArgse)
{
//int[] T_ADC = new int[3];
<pre>
array[0].DC =12
array[0].IN[0] = 11;
array[0].us[0, 0] = 1;
}</pre>
|
|
|
|
|
Um...
public int[] DC;
...
array[0].DC = 12;
You can't assign an integer value to an array!
So either change the declaration of DC, or change what you are assigning to it!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
How can I change the declaration??
|
|
|
|
|
Drop the [] so you aren't returning an array.
|
|
|
|
|
XKCD has never felt so real...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I'm trying not to judge, but it's hard.
|
|
|
|
|
|
Certainly, if your code read this, for instance:
int[] item = 1; That would generate a compiler error because 1 is not an array of integers. If you only want one value, change it to
int item = 1; See how [] has been removed.
|
|
|
|
|
But can you show me where the backspace key is please?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
hi
i have attached font in my C# WinForm program.
this is the code:
System.Drawing.Text.PrivateFontCollection privateFonts = new PrivateFontCollection();
privateFonts.AddFontFile(Application.StartupPath + @"\MyFont.ttf");
System.Drawing.Font font = new Font(privateFonts.Families[0], 120);
lblMSG.Font = font;
when i run in the solution i see the font excelent.
but after i make setup to my program, and i install and run the program
i cant see the font (i see empty...)
(Of course that i attached the MyFont.ttf file to my app folder)
and i got this error:
Parameter is not valid
how to fix it ?
thanks
|
|
|
|
|
Did you add the font file to your program folder? Usually if you add a font file to an installer the tool will add install the font in the system Fonts folder, not your application folder. The code you're using expects to find the font file in the same folder as the .EXE.
|
|
|
|
|
thanks for the help,
i change my code like this:
privateFonts.AddFontFile( @"c:\Windows\Fonts\XX.ttf");
but after i install my program i got message that can't find the file
|
|
|
|
|
OK, the thing to do is to NOT change the code. You should be diagnosing what the installer is doing with that font file. Find out first, then react to it.
|
|
|
|
|
Is the file actually there? If no, your installer is in error. If yes, you're probably passing another path.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks for the help,
after the install i see the font file in my application folder
but still same error.....
|
|
|
|
|
how do i make my program autorun when my computer open(windows service)?
|
|
|
|
|
Not enough information.
What is this program supposed to do? Does it require a user interface? Is it support to start doing it's processing when Windows starts, or when a user logs in?
Windows Service applications starts after Windows starts and do not show an interface at all. You'd have to write your application specifically as a Service application.
|
|
|
|
|
Create an application which will call the web services or do what ever you want...then make an exe..put that exe in C:\Users\arka\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup this location. As your computer will start your app within this path will execute.
|
|
|
|
|
That location doesn't start an app when Windows starts. That starts an app when that user logs in.
|
|
|
|
|
Arkadeep De wrote: As your computer will start your app within this path will execute. Some cleaning apps might flag it as possible malware though; the start-menu folder usually contains links to executables, not executables itself.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I was just reading someone's blog where he tested
bool isEmpty = (MyString == "");
bool isEmpty = string.IsNullOrEmpty(MyString);
bool isEmpty = string.IsNullOrWhiteSpace(MyString);
bool isEmpty = MyString.Equals("");
bool isEmpty = MyString.Length == 0;
and he listed the number of ticks each example took.
That got me thinking....
If you wanted to know of a string was null, that's one thing, and determining if its an empty string is another.
But do you REALLY care about TICKS???
With today's PC's and Servers running at ultra high speed, why would anyone really care?
Bonus question: I prefer IsNullOrWhiteSpace. What's your favorite & why?
If it's not broken, fix it until it is
|
|
|
|