698 Posted Topics
Re: AS DdoubleD pointed out, you are correctly using the .Text property on some values but passing the control in others. Also, while there are no hard and fast rule for naming conventions, it is common to use a prefix rather than suffix to identify control types. For example, tbPickup (although … | |
Re: What error do you get? The code looks right so it should convert the string. | |
Re: Not sure what you mean by "after making setup" but you can put a try catch block in your Main() method: [CODE] static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new Form1()); } … | |
Re: You can store the current selection and reapply it after you have processed the text: [CODE] private void timer2_Tick(object sender, EventArgs e) { int start = txtHighlight.SelectionStart; int length = txtHighlight.SelectionLength; //process text txtHighlight.Select(start, length); } [/CODE] | |
Re: I'm not entirely sure why you are trying to inherit from your forms, i'll leave that to someone who knows more. But your second question, the best way to pass data between forms, and maintain encapsulation, is to use a public property: [CODE] public partial class Form3 { private string … | |
Re: if you solved it yourself dont forget to mark the thread as solved :) | |
Re: It depends what type of control you are using. I havent worked with them much, but i believe the older DataGird controls had a rowspan and columnspan attribute. The newer DataGridView doesnt support this. There are third party controls that have this, or you can do it yourself. Generally this … | |
Re: Hi, As a new member, b e sure to check out [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]Member Rules[/URL]. There are some guidlines in there for posting to the forums. One of those rules is to use descriptive titles for threads. "****" doesnt tell forum users what your thread is about. By using decriptive titles you … | |
Re: As a new member you should check out [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]Member Rules[/URL]. If you keep your threads neat and follow the rules, it easier for posters to help you and easier for others to find information they need. As ddanbe pointed out, new questions should be in new threads. Also, you should … | |
Re: If you are printing using a PrintDocument object then you can try altering the .DefaultPageSettings.PaperSize property. | |
How to Handle Events Event handlers make up a large portion of Windows Form Coding. There have been a lot of questions on the C# forum of late that stemmed from people creating Event Handlers incorrectly. First lets look at how an event and its event handler works: Each event … | |
Re: First of all, C# doesnt have functions, they are methods. I'm on a crusade to eradicate that word from this board ;) Secondly, how is the method declared, private/public/protected? How have you created your reference to the parent form? | |
Re: are you sure its 7f to -80 and not 00 to ff? As far as i'm aware you dont have a signed hex so -80 is wrong. I'd double check it, but i think they mean that 00 = -128 and ff = 127 in which case you need to … | |
Re: The structure you're trying to achieve would be better suited to a treeview. You could have each group as a root node then each year as a child of the group node. The treeview has an option to show checkboxes. You will still have checkboxes on the groups too (unless … | |
Re: The problem you are having is related to how MdiParent forms are handled. When you set the isMdiContainer property to true it creates an MdiClient control on the form. This control is docked to fill the form and set behind all the other controls. Whenever you add a child form … | |
Re: try: C:\test\app.exe C:\test\plugin.dll C:\test\functions.dll | |
Re: When you say nothing happens, does the code in the event handler not work or does it not run? Have you checked that the event handler has been bound to the event? Chcek out [URL="http://www.daniweb.com/code/snippet241539.html"]my tutorial[/URL], let me know if it clears things up :) | |
Re: why not just use the 'ALL' checkChanged event to set all the other checkboxes to be checked. That way it will write the list with all the cars in it the same way as if you had manually clicked on each checkbox :) [CODE] private void chbAll_CheckedChanged(object sender, EventArgs e) … | |
Re: You are creating a new instance of ClientInfo and calling the displayClient method on that instance. Is ClientInfo the name of your main form? You need to run the displayClient method from the original form, not in a new instance. The best way to do that (if you are showing … | |
Re: 3 responses: 1) Forum Rules require that the title be descriptive. Please avoid generic titles like "3 Questions" instead describe what the questions relate to. 2) Here at Daniweb [URL="http://www.daniweb.com/forums/announcement61-2.html"]We only give homework help to those who show effort [/URL]. You need to attempt the questions yourself. If you get … | |
Re: as adatapost rightly said, you should not create multiple threads for the same issue, and the forum rules do state that titles should be descriptive. As for the zooming issue, i gave you a link in your previous thread to bob powell's [URL="http://www.bobpowell.net/transformations.htm"]GDI+ tutorials[/URL]. You can use scale and translate … | |
Re: You can use a boolean flag like this: [CODE] bool isSuspended = false; private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (isSuspended) return; //process selected index changed } private void button13_Click(object sender, EventArgs e) { isSuspended = true; //process code which causes lsit to rebind isSuspended = false; } [/CODE] … | |
Re: Hey, have you got a sample image you can upload so i can run the code? | |
Re: ok, two things: 1) your loop is only running once because you arent setting ctr1 back to zero before your first while loop so it starts at 9, gets incremented once and never hits the [iCODE]if(ctr1==9) break; [/iCODE] statement. insert [iCODE]ctr1 = 0;[/iCODE] between lines 32 and 33. Your code … | |
Re: Open the Form1.designer.cs file and check for this line: [iCODE]this.lstNames.SelectedIndexChanged += new System.EventHandler(this.lstNames_SelectedIndexChanged);[/iCODE] This is the line that tells the compiler what method to fire when the event is raised. You can create this event handler in several ways: 1) Add it manually in the the form constructor method: [CODE] … | |
Re: Depending on what you mean by "distorted" it sounds like you are having problems with the way the application fires Paint events. Do you have code you can paste so that we can isolate the issue for you? | |
Re: ddanbe is correct in his breakdown of the problem, you can create a Class/Struct to store each persons data, then store all the objects in a List<> collection. When the selectedIndex of the listbox is changed you either iterate through each item in the list to find the match or … | |
Re: So you are passing an unknown number of arrays to the method...are they of different data types? If so, how many different data types? Also, what are you trying to achieve, if we know why you are trying to do this we may be able to offer a more efficient … | |
Re: [QUOTE=zasch;1055693]If you have already started with C++ then I'd suggest you to go on with it untill you feel comfortable with the language and do some programming. Later on if you wish to start learning C#, it'll be easy for you to go ahead with c#. -z[/QUOTE] I agree, once … | |
Re: i think you need to re-read [URL="http://msdn.microsoft.com/en-us/magazine/cc163807.aspx"]the article[/URL] adatapost offered. Second paragraph clearly states [QUOTE]This article presents a set of interacting helper classes that enable a Windows Forms application to use the ASP.NET credentials management infrastructure, with the same ease as if it were an ASP.NET application.[/QUOTE] Likewise, the login … | |
Re: Can you clarify for me, do you have some custom hardware which you would like to interface with the PC as if it were a joystick, or do you want to write software which will create output as if it were a joystick? | |
Re: As long as you are reusing the same variables for each block then it is essentially doing the same as a loop. As you said, the extra lines of code will increase your file size slightly. As DdoubleD pointed out, the problem is more to do with readability and maintainance...if … | |
Re: Another way to find an element in a List is to use the .Find() method. The syntax can be a little daunting if your new to C# but its fairly simple once you get used to it :) you can check out the [URL="http://msdn.microsoft.com/en-us/library/x0b5b5bc.aspx"]msdn page[/URL] for predicate search, it shows … | |
Re: it is only slightly less cumbersome, but you can use inline If statements: [CODE]Convert.ToInt32((string.IsNullOrEmpty(LeaveDay.Text)) ? "0" : LeaveDay.Text)[/CODE] If LeaveDay.Text is empty or null it will use "0", otherwise it uses LeaveDay.Text. Or possibly try using [CODE] int Day; int.TryParse(LeaveDay.Text, out Day); [/CODE] if tryparse suceeds it will place the … | |
Re: is this related to the [URL="http://www.daniweb.com/forums/thread239420.html"]image distorted thread[/URL] you had? Have you had a chance to look at my response to that? I managed to get the code you had working, it was an issue with the padding in bitmapdata arrays. If this is unrelated, then can you be more … | |
Re: Could you clarify what you mean by an id? Do you mean something like an Identification Card? There are a number of ways to present a line on the screen, but which one you use depends on what you are trying to acheive. You can use Paint methods to draw … | |
Re: There is a link to [URL="http://www.codeproject.com/KB/cs/globalhook.aspx"]this article[/URL] in the thread DdoubleD posted. It shows you what you need to do. It is a global hook, that will recieve the mouse/keyboard events from windows. | |
Re: Wow! Yes, there is definitely a better way to write that :) Firstly, and these are moot points since your going to scrap that and start over (i hope), but you are storing your values as strings then converting them to doubles...why not just store them as an array of … | |
Re: For text file access i use StreamReader and StreamWriter objects. You can use them to write a new line for each packet of data as it is recieved: [CODE] using System; using System.IO; class Test { public static void Main() { // Create an instance of StreamWriter to write text … | |
Re: The above will work if you are using threads. If you are not using a threaded application you could look at the timer class. What does your application do, and why do you need the timer delay? | |
Re: @memory100 - did you resolve your issue? if not, what error are you recieving? @kool.net - please dont piggyback onto threads. If you ahve a problem you can create a thread and get help specific to your problem. Adding new problems to related threads leads to confusion. | |
Re: it depends how you are displaying your graph. Are you using a graph control, or are you drawing it in a picturebox? | |
Re: You can only return a single object from the method, but that object can contain multiple values depending on its type; you can use a collection to return multiple values of the same type, or the following uses a struct to return a bool and a string: [CODE] public partial … | |
Re: When you say you cant see, do you mean the datagrid does not contain any values? | |
Re: Please avoid creating duplicate threads. Escpecially when people have responded to your earlier post: [URL="http://www.daniweb.com/forums/thread237721.html"]need help[/URL]. The forum shows threads in order of most recent posts so if you had answered the questions we asked your old thread would have been bumped back to the top of the list anyway. … | |
Re: Where in your code are you drawing the line? If you want the line to persist through changes in teh client, you could draw it in an overridden Paint() method on the form. If you use thew ClientRectangle as ddanbe suggested it will always be drawn relative to your forms … | |
Re: What type of collection is playingDeck and how many objects are in it when thew exception occurs? If the collection is empty then count will return 0 which will throw an OutOfBoundsException because the second parameter must be equal to or larger than the first in the Random.Next() method call. … | |
Re: try: [CODE] if (bokstav == enBokstav) { bool letterExists = false; for (int arrIndex = 0; arrIndex < gjettet_bokstaver.Length; arrIndex++) { if (bokstav == gjettet_bokstaver[arrIndex]) { MessageBox.Show("Du har allerede brukt den bokstaven"); letterExists = true; } } if (!letterExists) { gjettet_bokstaver[array_size] += bokstav; array_size++; RiktigBokstav.Text += gjettet_bokstaver[(array_size - 1)]; } … | |
Re: [QUOTE=brightsolar;1044363] i would very much like some information about key pressing so when the use presses the key enter return ( char 13). i did try - but my key press_ down just does not work. ----------------------------------------------------------------------------------------------- [/QUOTE] MeSampath pretty much covered it, only thing i'd mention is to check … | |
Re: [QUOTE=Diamonddrake;1044808]um... What?[/QUOTE] Ditto...can you be a little more specific please? What do you mean by "layers"? Are you asking for a step by step on creating a windows application in vs.net, if so there are a great many beginners tutorials out there. If you run into a specific problem we … |
The End.