I was wondering if you figured this out as i have the same problem :)
Adam Turner
Posts
-
Setup Questionn -
Run installed applicationthanks.... Do you know of any examples for "Windows Form application launch using touchless deployment"? I did read something about Click Once deployment from MS but that is coming in Whidbey.
-
Run installed applicationIf i know that there is an application installed on a PC, that is viewing my web page, is there a way in which i can run that application (outside of the browser)? If not, then if a user selects a link (or button or something) to download a winform application (and cache it) and run it on the client outside of IE? thanks for any help
-
Converting an Image to an IconBasically, i want to know if there is a way to convert an Image to an Icon in C#. I tried the Icon constructor which accepts a Stream object and a Memory stream accepts a byte[], but i wasnt sure how to convert an Image to a byte[]. I am loading a .png file into memory to show a status, but i also have to show the same image in the form's icon and i dont want to have a .ico and a .png file for every status. Thanks for the help.
-
Trial versionHi, I was wondering if you ever got to write the article about this? I am very interested and it sounds exactly like what i want. Even some sample code would be great --Adam Turner
-
Unique numbers in SQLYou could also setup in the DataSet that the column is auto-increment. So whenever you insert a new record, it will create a new ID for you. There is a problem with this though, as the ID always starts at 1 (or if populated from the Db, the last ID). So if your DB has 5 records in it with IDs of 1 though 5. And you retrieve ID 3 into your DataSet and add a new record, the ID will be 4. Now if you try to save it back to the database, it will error. Hope this helps
-
Only exposing interfaces from the serverYou might be able to use internal on all other classes except your facades/interfaces. That should 'hide' those classes from all outside calls.
-
Reducing the size of an ArrayIf i create an array that is a specific size
int[] myInts = new int[10]
but only fill the first 5 values, how can i reduce the length of the array to 5? so the following will happen
myInts[0] = 5;
myInts[1] = 4;
myInts[2] = 3;
myInts[3] = 2;
myInts[4] = 1;
for (int i = 0; i < myInts.Length; i++)
{
Console.WriteLine(myInts[i].ToString());
}and the output would only be 5, 4, 3, 2, 1 and not throw an exception since myInts[5] is null
-
Firing an event from outside the classIs there a way to fire an event from a class, from outside that class? I mean, if i have something like the following, can ClassA fire ClassB's Click event?
public class ClassA
{
ClassB myB;
}
public class ClassB
{
public event EventHandler Click;
}I tried
myB.BeginInvoke(myB.Click, new object[] {null, null});
but it didnt compile Thanks Adam
-
Windows.forms applicationInstead of using MDI, you could create all of your "forms" as user controls and just handle their loading/unloading on the same form
-
Remoting and FinalizeMarshalByRefObject doesnt derive from Componnet so doesnt have Dispose, and you need to derive a remoted object from MarshalByRefObject.
-
Remoting and FinalizeI know that. I am using it as a base for some work that i am doing. But i dont know when the remoted object is destroyed, so i wanted to know about Finalize, since MarshalByRefObject doesnt derive from Componnet so doesnt have Dispose.
-
Remoting and FinalizeI want to setup a remote singleton that keeps a sequence (and increments it). I get the last sequence number from a database and before the object is garbage collected i want to save the value back to the database. Should/Can i implement this in the singleton's finalize method or is there someway to use ILease and when Sponsorship times out, then save to the database?
-
Argument-substitution vs ConcatenationThe first way (using String.Format essentially) is a little more useful i think under a scenario like the following
Console.WriteLine("a = {0} and a = {0} and b = {1}", a, b);
vs
Console.WriteLine("a = " + a + " and a = " + a + " and b = " + b);
-
Correct way to abort a Suspended thread?try Give Your .NET-based Application a Fast and Responsive UI with Multiple Threads by Ian Griffits
-
Maximizing Event (Or Not)Thanks but i have never overriden this method before. Where do i get the values of WM_XXX and other message constants?
-
Maximizing Event (Or Not)What is the event that is fired when maximizing a form? or minimizing for that matter. I currently have put a delegate on the Resize event and checking for FormWindowState.Maximized. Is this the only way of doing it? or even the correct way? Basically i dont want to actually maximize my form. I want to change its height to a certain value while not changing the top and left of the form. But the WindowsState is only changed to FormWindowState.Maximized when the form is actually maximized and not before when it starts. Any help is appreciated. --ABT
-
Powering through statementsHA. :-D That is extactly the work around that i am using.
-
Powering through statementsBasically, i dont care if a set of statements throws an exception but i dont want the program flow to be interupted. How can i do this? Something like the following:
int[] manyInts = new int[4]; manyInts[0] = 1; manyInts[1] = 1; manyInts[2] = 1; manyInts[3] = 1; manyInts[4] = 1; manyInts[5] = 1;
So basically it executes every statement whether it thows an exception or not. -- ABT -
Sharing data between forms???You can do it a couple of ways depending on the relationship between Form1 and Form2. (e.g. Form1 creates Form2, Form2 creates Form1 or Form3 creates both). For "Form1 creates Form2", you can pass an instance of Form1 to Form2
public Form2 { public Form2(Form1 f) { } } ...
and then when Form1 is constructing Form2:Form2 f = new Form2(this);
if "Form2 creates Form1", then you can just setup a public property in Form1 that gets the text from the label but you must keep an instance of Form1 as a field in Form2 so that your function can access it. And the "Form3 creates both", then construct Form1 first, and then pass its instance to Form2. --Adam Turner