- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 21
- Posts with Upvotes
- 16
- Upvoting Members
- 12
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
59 Posted Topics
Re: Note that the [icode]params[/icode] keyword is not required unless you are going to add individual ints as multiple parameters to the method. | |
Re: I think from what you have said you need to get the optimal price for the space/weight allowed a very interesting problem, this is a version of the multi-dimensional knapsack problem. See [URL="http://tracer.lcc.uma.es/problems/multi01knap/knap.htm"]here [/URL] for an in depth description of the problem. From the layout of this question I guess … | |
Re: If you are using an rich text edit just use the line breaks, most apps that compare and highlight changes in lines will highlight the actual change and the line number part of the display. In short I would just use the default action. | |
Re: Why do you need to create a builder app to do that? Could you not just use user configuration settings. (Properties.Settings in a forms app) | |
Re: Yep that should work just the same way as any other key. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx"]Microsofts SendKeys Description [/URL] | |
Re: Have a look at this thread: [URL="http://social.msdn.microsoft.com/Forums/en-US/windowssecurity/thread/10c6ff4b-701b-4351-a3d8-a716d8831a66"]http://social.msdn.microsoft.com/Forums/en-US/windowssecurity/thread/10c6ff4b-701b-4351-a3d8-a716d8831a66[/URL] | |
Re: FYI: When creating graphics in a Windows Forms App by default you use GDI+. It's not normally called WFA hence ddanbe's confusion. You can look at using either WPF or DirectX depending on the requirements you have. googleing either will give alot of tutorials and furthur information. | |
Re: I think I see the problem: If you have a argument that is a string you would assign it like this [icode]string str = "'001', '002', '003'"; [/icode] now if you added that to your query like this [icode] string.format("Select * from ... where appName in {0};", str); [/icode] it … | |
Re: Have a look at the below, the System.Diagnostics.Process class. [CODE] Process[] processes = Process.GetProcesses(); ... Process p = Process.GetProcessesByName("aname"); p.Kill(); [/CODE] | |
Re: I don't think I quite understand what you are trying to achieve. If you want to access the same static methods/functions from a number of places the best way to do this is to create a class like this: [CODE] public class MyClass { public static bool MyMethod(float arg) { … | |
Re: Um ignore IceMans post as the example is in C/C++. To do this using a form is quite simple. In the properties of designer select the events tab and double click the gap next to KeyPress to create the event handler code for you. Now do somthing like below: [CODE] … | |
Re: In newer versions of .Net you can declare properties like this: [CODE] // For a simple property (this is useful because properties // are thread safe) public int MyInt{get; set;} // To allow it to only set with the current class but viewable outside public int MyInt{get; private set;} [/CODE] … | |
Re: You could use a standard for loop: [CODE] for(int index=0; index < hashtable.Keys.Count; index++) { switch(hashtable.Keys[index]) { ... } } [/CODE] | |
Re: Is this of any use to you? [URL="http://www.codeproject.com/KB/system/cstcpipwmi.aspx"]http://www.codeproject.com/KB/system/cstcpipwmi.aspx[/URL] | |
Re: It could be a threading issue or somthing similar. What happens when you step through it and have you tried using try and catch around the affected code? | |
Re: 1/. An IntPtr is a pointer to an int you can convert it easily to either int32 or int64 (int and long respectivly) see below: [CODE] int i = 10; IntPtr p = new IntPtr(i); int aInt = p.ToInt32(); long aLong = p.ToInt64(); [/CODE] 2/. All that code is doing … | |
Re: It's also worth noting that you can use the -= operator to stop the delegate pointing to a method e.g. [CODE] Car myCar = new Car(); public void Start() { myCar.Crash += new Car.CrashEventHandler(myMethod); } private void myMethod() { ... } public void Stop() { myCar.Crash -= new Car.CrashEventHandler(myMethod); } … | |
Re: I think the way to do this is to use a manifest file as explained [URL="http://www.enusbaum.com/blog/2007/08/26/how-to-run-your-c-application-as-administrator-in-windows-vista/"]here[/URL]. I think this will still prompt the user to click the run as admin popup though. | |
Re: Yep you really should use parameterised querys instead of directly inserting arguments into strings! See security issues regarding SQL injection etc. I tend to use somthing like this: [CODE] public DataSet Query(string sql, params SqlParameter[] args) { try { SqlConnection connection = new SqlConnection(this._connection); SqlCommand command = new SqlCommand(sql, connection); … | |
Re: 1/. You don't need a new method for every button just call the same method and do somthing like this: [CODE] private void btnLetter_Click(object sender, EventArgs e) { if (Pwdsel == 1) { insertStringPass((sender as Button).Text, this.Password.SelectionStart); } else { insertStringUser((sender as Button).Text, this.Username.SelectionStart); } } [/CODE] 2/. You should … | |
Re: If you are in the new item dialog you have gone too far. The 'Component...' option is in the add menu second from bottom. I am using VS 2008 | |
Re: I am not 100% sure what you actually want to know. If the time in the database is 'DateTime' or 'SmallDateTime' then no matter how you pass a date it will store it with hours mins and seconds. If you just pass a date then the database will contain a … | |
Re: You will still need the .Net framework for your executable to run on the target machine. If your executable references any other dlls then you will need to add those too. You need the .Net framework because the exe you have is not a set of machine code instructions that … | |
Re: You will need to call CreateChart() using a Chart object as an argument I presume that there is a Chart described in dotnetCHARTING.WinForms that you will need to use. I don't know what a Chart is so I can't be sure but I suspect you need to do somthing like … | |
Re: What you are looking for is a sorting algorithm, there are a few of these and they vary in complexity from the recursive Quicksort to a simple Bubble sort. This tutorial gives you code and a more in depth explaination:[URL="http://www.publicjoe.f9.co.uk/csharp/sort00.html"]http://www.publicjoe.f9.co.uk/csharp/sort00.html[/URL] | |
Re: If you did not force all the elements of an interface then what would happen when a missing element was called? (see below) [CODE] foreach(ITemp tmp in myCollection) { string name = tmp.GetName(); } [/CODE] | |
Re: What do you have so far? | |
Re: It's probabbly because you have a console app and Message is part of System.Windows.Forms eg not included in a console app by default. Even if you add the assembly reference I don't think the WndProc will work unless you have a form. | |
Re: Is the dll import expecting it to be in 'Windows\System32' or somthing similar? | |
I have a small WMI issue that I am having trouble with. I am using root\WMI:MSSerial but would like to retrieve properties from both MSSerial_PortName and MSSerial_CommInfo specifically the following properties PortName, IsBusy and Active. If I query just one object then the code below works fine but I can't … | |
Re: There is a [icode]Column.Visible[/icode] property, you should be able to set that to false. How you do that depends on how you are binding the data to the grid view. | |
Re: Have a look at using XML files for settings and the like. | |
Re: Have you tried anything like this? If the library executes the event on a different thread you will get an error when you try to access UI components as they are on a different thread. [CODE] public void OnSwyxEvent(int msg, int param) { if (this.InvokeRequired) { this.Invoke(new Action<int, int>(OnSwyxEvent), msg, … | |
Re: Ok, my knowledge of complex numbers is scant to say the least. This to me looks like a maths question hidden inside a c# question. To answer the c# part just assign the Text property of the edit box with the value eg. [CODE] float a = 0.23f; textBox1.Text = … | |
Re: You could use a database with related search terms included in a record with the url of the relevent image. You could also use metadata to search through images. It really depends what you need to do... | |
Re: You will need to somhow get hold of the Canon SDK. To do that you used to have to register as a developer on the cannon website but It's been a while since I looked at this. | |
Re: I don't see why you would need one, the operating system should deal with that for you. Do you really mean toolbar, if you do look for ToolStrip and ToolStripContainer in the toolbox. | |
Re: Look at [icode]RichTextBox.Select()[/icode], see if the code below helps: [CODE] // The draw back to this is if a line wraps it will continue the // selection until a newline char is found. int startIndex = myRtfEdit.GetFirstCharIndexOfCurrentLine(); int selectionLength = myRtfEdit.Text.IndexOf('\n', startIndex) - startIndex; if(selectionLength > 0) myRtfEdit.Select(startIndex, selectionLength); [/CODE] | |
Re: [QUOTE] [CODE] public TreeNode FindInstanceNode(string SubContainer,string instance) { TreeNode Node = GetTreeViewClickedNode(); foreach (TreeNode trNode in Node.Nodes) { if (trNode.Text == "SUB-CONTAINERS") { TreeNodeCollection tcSubNodes = trNode.Nodes; foreach (TreeNode trInode in tcSubNodes) { TreeNodeCollection tcInsNodes = trInode.Nodes; foreach (TreeNode InstanceNode in tcInsNodes) { if (InstanceNode.Text == "INSTANCE" && InstanceNode.FirstNode.Name == … | |
Re: I don't think this is relevent to this forum. In most cases you just move your source files to the active directory of your server but you have not supplied enough information for me to answer your question. | |
![]() | Re: Note that the below are links: 1/. [URL="http://support.microsoft.com/kb/311566"]Read Xml into the dataset[/URL] 2/. [URL="http://en.csharp-online.net/Presenting_Data_with_the_DataGridView_Control_in_.NET_2.0%E2%80%94Basic_Data_Binding_with_the_DataGridView"]Use binding to link your dataset with the grid view[/URL] 3/. [URL="http://quickstart.developerfusion.co.uk/quickstart/howto/doc/Xml/SaveDataSetXML.aspx"]Save the dataset as Xml[/URL] |
Re: I think in most cases like this the server is built into the client so that you don't need a seperate server app. I would look at using UDP broadcasts for finding people who are online and then creating a client server link using TCP between the person initiatinag a … | |
Re: Have a look at this thread: [URL="http://www.daniweb.com/forums/thread242898.html"]http://www.daniweb.com/forums/thread242898.html[/URL] | |
Re: That looks very much like C rather than C#. I think [ICODE] if (amt = % 10 = 0) [/ICODE] should read [ICODE] if( (amt % 10) == 0) [/ICODE] it looks to me like you are assigning the modulo value to amt though I am unsure if this is … | |
Re: If you want to display the image in the browser, I think, you should use an asp:control so you can reference it from the server side asp like this: [CODE] <body> <form runat="server"> ... <asp:Image ID="Image1" runat="server" /> ... </form> </body> [/CODE] To set the url use the following in … | |
Re: In C#: [CODE] DateTime time1 = DateTime.Parse("09/11/2000"); DateTime time2 = DateTime.Parse("09/12/2000"); if(time1 > time2) {...} [/CODE] | |
Re: I don't think it is possible to cast generic lists like that although object is the base and float inherits object that is not the cas when it comes to generic lists. I think i'd try somthing like this: [CODE] List<object> temp = new List<object>(); temp.Add((float)20.5); temp.Add((float)21.5); temp.Add((float)22.5); List<float> temp2 … | |
Re: I would look at WCF more closely it is based on SOAP and may be what you are looking for by the sounds of it. See: [URL="http://msdn.microsoft.com/en-us/library/ms731082.aspx"]Microsoft What is WCF[/URL] | |
Re: I need a bit more information about what you are trying to do before I can be much help. To use multithreading have a look at delegates and the BeginInvoke() method. There is lots of information available about multi threading and worker threads out there. |
The End.