698 Posted Topics

Member Avatar for c#noob

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 …

Member Avatar for Geekitygeek
0
206
Member Avatar for Drahmina

What error do you get? The code looks right so it should convert the string.

Member Avatar for Ravenheart
0
263
Member Avatar for dima shawahneh

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()); } …

Member Avatar for Geekitygeek
0
174
Member Avatar for MxDev

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]

Member Avatar for MxDev
0
76
Member Avatar for Mitja Bonca

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 …

Member Avatar for Geekitygeek
1
255
Member Avatar for Jaydenn
Member Avatar for Geekitygeek
0
84
Member Avatar for all4peace

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 …

Member Avatar for reach_shailshar
0
153
Member Avatar for rzhaley
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 …

Member Avatar for Geekitygeek
0
149
Member Avatar for student88
Re: hi

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 …

Member Avatar for Geekitygeek
0
159
Member Avatar for nccsbim071

If you are printing using a PrintDocument object then you can try altering the .DefaultPageSettings.PaperSize property.

Member Avatar for nccsbim071
0
149
Member Avatar for Geekitygeek

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 …

Member Avatar for Nick Evan
3
947
Member Avatar for plastic

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?

Member Avatar for DdoubleD
0
524
Member Avatar for XshulderX

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 …

Member Avatar for ddanbe
0
98
Member Avatar for jduff8

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 …

Member Avatar for Geekitygeek
0
102
Member Avatar for plastic

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 …

Member Avatar for Geekitygeek
0
100
Member Avatar for tincho87
Member Avatar for lepass_7

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 :)

Member Avatar for Geekitygeek
0
141
Member Avatar for jduff8

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) …

Member Avatar for Geekitygeek
0
80
Member Avatar for prilton

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 …

Member Avatar for Geekitygeek
0
125
Member Avatar for Blue_Eyez

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 …

Member Avatar for crazyboy
-4
95
Member Avatar for sidd.
Re: zoom

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 …

Member Avatar for Geekitygeek
0
97
Member Avatar for NguyenThai

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] …

Member Avatar for Geekitygeek
0
219
Member Avatar for vikram89

Hey, have you got a sample image you can upload so i can run the code?

Member Avatar for vikram89
-1
553
Member Avatar for sathya8819

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 …

Member Avatar for Geekitygeek
0
305
Member Avatar for bravo659

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] …

Member Avatar for Geekitygeek
0
2K
Member Avatar for sathya8819

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?

Member Avatar for sathya8819
0
703
Member Avatar for RogerBailey

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 …

Member Avatar for ddanbe
0
180
Member Avatar for CanYouHandstand

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 …

Member Avatar for CanYouHandstand
0
1K
Member Avatar for epicasian

[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 …

Member Avatar for RoyMicro
0
176
Member Avatar for abc16

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 …

Member Avatar for Geekitygeek
0
448
Member Avatar for Voulnet

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?

Member Avatar for Voulnet
0
3K
Member Avatar for RoyMicro

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 …

Member Avatar for RoyMicro
2
90
Member Avatar for Gerard I MUFC

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 …

Member Avatar for Gerard I MUFC
1
354
Member Avatar for snakay

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 …

Member Avatar for snakay
0
123
Member Avatar for sathya8819

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 …

Member Avatar for Geekitygeek
0
473
Member Avatar for annaqah

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 …

Member Avatar for ddanbe
0
327
Member Avatar for Dum_

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.

Member Avatar for Geekitygeek
0
182
Member Avatar for brightsolar

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 …

Member Avatar for Geekitygeek
0
100
Member Avatar for RoyMicro

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 …

Member Avatar for Geekitygeek
2
191
Member Avatar for sidd.

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?

Member Avatar for Geekitygeek
-1
148
Member Avatar for memory100

@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.

Member Avatar for Geekitygeek
0
157
Member Avatar for sidd.

it depends how you are displaying your graph. Are you using a graph control, or are you drawing it in a picturebox?

Member Avatar for Geekitygeek
0
387
Member Avatar for foxypj

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 …

Member Avatar for Geekitygeek
0
111
Member Avatar for botaxsmaniz
Member Avatar for DdoubleD
0
934
Member Avatar for memory100

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. …

Member Avatar for Geekitygeek
0
106
Member Avatar for sidd.
Re: line

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 …

Member Avatar for Geekitygeek
0
105
Member Avatar for wesleychin

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. …

Member Avatar for Geekitygeek
0
138
Member Avatar for CyberPirate1

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)]; } …

Member Avatar for Geekitygeek
0
145
Member Avatar for brightsolar

[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 …

Member Avatar for brightsolar
0
159
Member Avatar for rutaba

[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 …

Member Avatar for DdoubleD
0
187

The End.