698 Posted Topics

Member Avatar for lishannx

If you want to move the button around, use the mousedown and mouse up events to capture the start and end point of the mouse drag and alter the buttons location property according to the direction and distance the mouse moves

Member Avatar for fkomment
0
151
Member Avatar for Geekitygeek

Hi guys, I've been having a hellish time of it this week. First my case fan died, after replacing that my CPU fan died! Installed a new one and my computer wouldnt start at all...hmpph. I took it all out and bench ran it and it started fine, and when …

Member Avatar for WASDted
0
155
Member Avatar for Geekitygeek

This seems to be coming up in a LOT of posts at the moment so i figured i would put it into a handy code snippet to save us keep typing it. To access controls on a form you need to have a reference to the current instance of that …

Member Avatar for beetscodes
3
1K
Member Avatar for funfullson

I think what MARKAND911 and Diamonddrake are trying to suggest is that instead of adding new columns to your table you should have a seperate table in your database to store your costs. It is a very poor design to add columns the way you are. You shouldnt be adding …

Member Avatar for nsdoshi
0
104
Member Avatar for rzhaley

You shouldnt use reserved words for Class/Member names. Why have you changed [iCODE]public static class DisplayPairs[/iCODE] to [iCODE]public static class Class[/iCODE]? Also, the class has been declared as static so you dont need to create an instance of it, static means that there is only ever [B]one[/B] instance that exists …

Member Avatar for Ceerno
0
117
Member Avatar for deepak_1706
Member Avatar for jigglymig1

Try something like: [CODE] int[] a = new int[10]; for (int i = 0; i < a.Length; i++) { a[i] = 1; } [/CODE] Worth noting; the above does highlight why using meaningless variable names for anything more than loops (and sometimes even for those) is a bad idea :p

Member Avatar for Momerath
0
105
Member Avatar for ali_zdn

If all of your classes will store the same data but relevant to different cities then you could add a City member to the class, eg: [CODE] class City { string Name; string Number; string City; } [/CODE] Your class would obviously include the necessary properties, modifiers, etc. If each …

Member Avatar for Geekitygeek
0
172
Member Avatar for VibhorG

He left me rep on the multicolour text thread so he is still haunting the boards...might be an idea :p It's his area of expertise right?

Member Avatar for dnlangela
0
2K
Member Avatar for Geekitygeek

Hi guys, I'm trying to model inheritence in a SQL database. I have a working structure but I'm wondering if theres a neater way of doing this. The database is to store product information. A product is made up of multiple parts and each part is made up of components. …

0
81
Member Avatar for jr042684

The ListBox's Item collection is of the 'object' type. The value displayed in the listbox is the result of the ToString() method of the object. If you override the ToString() method of your struct you can determine what is returned, and thus, what is displayed in the ListBox if you …

Member Avatar for jr042684
0
156
Member Avatar for AngelicOne

Alternatively, you can use IF ELSE in queries with SQL Server 2000 or newer. You can check if the item exists, if it doesn't then insert it. I have done something like this in the past: IF EXISTS ( SELECT * FROM user_table WHERE userid = @userID ) BEGIN SELECT …

Member Avatar for AngelicOne
0
190
Member Avatar for Geekitygeek

Its been a few years since i've coded any network applications so I was hoping for some suggestions on the best approach. I have written two programs which i now need to have them communicate with one another. They are both running on a LAN (over VPN) with static IP …

Member Avatar for mshauny
0
121
Member Avatar for rodce

[QUOTE=mshauny;1333983]yes, as an output it will make it 9, but i guess you never understood the question. he wanted to keep it with the length 9, not just for output. [/QUOTE] What Momerath offered was an alternative solution. Daniweb is a place for exchanging ideas and advise..there is no "one …

Member Avatar for mshauny
0
154
Member Avatar for ejazmusavi

if you want to be able to alter something after it is drawn you will need to store each object you draw in some way. I would recommend creating some classes. Create a base class for drawn objects that stores common details (location, colour, etc) then create some subclasses which …

Member Avatar for kvprajapati
0
450
Member Avatar for rutul

@mono_jit23: Your code would only split the values into a single array, the OP needs Numbers in one array and operators in another. @rutul: The problem you are going to have is dimensioning your arrays as you wont know how many Numbers and how many operators your string holds until …

Member Avatar for mono_jit23
1
1K
Member Avatar for a.slaughter

Check out the [URL="http://msdn.microsoft.com/en-us/library/486wc64h.aspx"]Control.FindControl[/URL] method :)

Member Avatar for a.slaughter
0
114
Member Avatar for Usmaan

Before I answer your question, I just want to cover a couple of things that you ought to know about this code: [CODE]if btAdd_Click() = true;[/CODE] Firstly, if you are [B]comparing[/B] objects you need to use the "equal to" operator which in C# is [iCODE]==[/iCODE]. ie [iCODE]if(x == y)[/iCODE]. When …

Member Avatar for Usmaan
0
18K
Member Avatar for judithSampathwa

If you have attached an event handler to the CellValidating event then it will always fire when focus leaves the cell. If there are cells that you dont want to validate (eg read only cells) then add a check at the start of the event handler that will cause it …

Member Avatar for Geekitygeek
0
4K
Member Avatar for divyakasani

Welcome to Daniweb, but please read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]forum rules[/URL] before posting. It is against the rules to "piggyback another" thread, if you have a question, start a new thread in the relevant forum. Also, here at Daniweb, we request that posters make an effort on their own before posting so …

Member Avatar for Geekitygeek
0
88
Member Avatar for pashaa

Hi udaraps. Please try not to resurrect old threads. Also, this is the C# forum, you woul dprobably have better luck posting your question over on the [URL="http://www.daniweb.com/forums/forum4.html"]VB 4/5/6 board[/URL].

Member Avatar for sbglobal
0
155
Member Avatar for Pari13

If the string is empty then the match will fail anyway since you require 1 or more of the first character. You will possibly throw an exception if you try a regex search on a null string so your better to check for null first, and if not null, then …

Member Avatar for Pari13
0
950
Member Avatar for Isha810

What is it you are trying to validate? You can't use start > stop or start < stop because you haven't got a date to determine order. For instance, if start date is 22:00 and stop date is 07:00 you cant tell if its 7am the following day (which is …

Member Avatar for Isha810
0
222
Member Avatar for judithSampathwa

If you are ever unsure about which event to use you can always check the [URL="http://msdn.microsoft.com/en-gb/library/ms123401.aspx"]msdn reference[/URL] for the class/control you are using. It has a very comprehensive [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview_events.aspx"]list of the events[/URL] and when they are raised: [QUOTE] CellEndEdit: Occurs when edit mode stops for the currently selected cell. [/QUOTE]

Member Avatar for Geekitygeek
0
163
Member Avatar for sommer_queen

I would recommend you look into the [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx"]BackGroundWorker[/URL] class. Its a useful wrapper for thread classes that provides Reporting, Cancelling and Result methods. You attach a method to the class which is then run in a separate thread. Within that method you can call ReportProgress method which can be used …

Member Avatar for edepperson
0
116
Member Avatar for zerey02

You should generally use Scope_Identity over @@Identity as @@Identity is connection based and may not reflect the last added row. Just so that i have it clear in my head, this is how i understand your order of execution: -Populate CheckedList with Authors -User enters details for a book -Add …

Member Avatar for Geekitygeek
0
194
Member Avatar for DeadSoul

You'll need to fix the following as well as implementing your search: [CODE]DateTime search1 = new DateTime(); string s = search1.ToString(Console.ReadLine());[/CODE] You have misused the overload of ToString. Where you have passed it Console.Readline() the method is expecting a format string to determine how to construct the string. You need …

Member Avatar for hanvyj
0
292
Member Avatar for Isha810

You can use DateTime.TryParse to convert each entered time into a DateTime. If it fails then you can alert the user: [CODE] static void Main(string[] args) { string startTime = Console.ReadLine(); string stopTime = Console.ReadLine(); DateTime start; DateTime stop; if (!DateTime.TryParse(startTime, out start)) { Console.WriteLine("Invlaid Start Time"); } if(!DateTime.TryParse(stopTime, out …

Member Avatar for Geekitygeek
0
124
Member Avatar for rico078

[QUOTE=Momerath;1328736]It will work if your goal is to briefly show the form then close it. [I]myform[/I] is a local variable and thus will go out of scope as soon as this method ends. This will cause [I]myform[/I] to immediately close. You need to rethink your form handling.[/QUOTE] You would think …

Member Avatar for Geekitygeek
0
100
Member Avatar for DaveTran

You could replace your SetB method with a property to access b, that way you can guarantee that the flag gets set regardless of where you change b from: [CODE] bool bHasChanged = false; int a; int _b; public int b { get { return _b; } set { bHasChanged …

Member Avatar for Geekitygeek
0
127
Member Avatar for anitha10

As an aside, you should generally store and check a hash of the password rather than the password itself as this is more secure. If the answers you have been given helped, please remember to mark this thread as solved :)

Member Avatar for Geekitygeek
0
171
Member Avatar for rahulvom

Firstly, please don't bump your threads...especially with duplicate posts. Secondly, if you are ever unsure of sql syntax there are great references online such as [URL="http://www.w3schools.com/sql/sql_update.asp"]W3CSchools[/URL]. You'll see in the link that the syntax you need is "UPDATE tablename SET column1 = @value1 WHERE column2 = @value2". Correct your update …

Member Avatar for Geekitygeek
0
122
Member Avatar for judithSampathwa

Nope, Windows Presentation Foundation allows you to produce move interactive and visually enhanced windows applications. I really [B]must[/B] find the time to get to grips with it myself :D

Member Avatar for Diamonddrake
0
149
Member Avatar for ancrawford

please use [noparse][CODE][/CODE][/noparse] tags when posting code. What is DateAndTime in your code?

Member Avatar for ancrawford
0
133
Member Avatar for SBA-CDeCinko

@rohand, I agree; rather than retrieving the list of words then having to iterate through them. Pass the body of the message to the database and use a LIKE condition. The database will be able to perform the match this way much quicker and more efficiently than any loop you …

Member Avatar for Geekitygeek
0
127
Member Avatar for sjn21682

Are you opening Form2 from Form1? Is Form2 opened modally (ShowDialog())? If you aren't showing it modally then check out my tutorial for [URL="http://www.daniweb.com/code/snippet298708.html"]accessing controls across forms[/URL] If you are showing it modally then you can add a public property to Form2 that returns the image and use that from …

Member Avatar for prvnkmr449
0
3K
Member Avatar for jayxx1234

I'm not sure if it can be translated to a control, but ddanbe posted a snippet a while back that [URL="http://www.daniweb.com/code/snippet227743.html"]rotated a string with a timer[/URL]. See if it inspires you :)

Member Avatar for jayxx1234
0
151
Member Avatar for Ancient Dragon

Definitely like the new rules :) Much easier. I agree that numbering the sections would help to point rule breakers to the relevant section..but at the same time, the rules are concise enough that it isn't a major issue; they should really read them all anyway :p What would that …

Member Avatar for Geekitygeek
0
157
Member Avatar for hanvyj

Your "getters and setters" are called properties. You can declare them in an interface (see [URL="http://msdn.microsoft.com/en-us/library/64syzecx(VS.80).aspx"]MSDN[/URL] for example). I haven't worked with COM classes for C++ so i don't know if there are additional restraints on the interface you create...hope this gets you in the right direction at least.

Member Avatar for hanvyj
0
150
Member Avatar for DaveTran

If MethodA doesnt have to run before B and C then you could use a do..while loop: [CODE] int i = 0; do { MethodB(); MethodC(); i++; } while (MethodA() != 0 && i < 5); [/CODE]

Member Avatar for Geekitygeek
0
99
Member Avatar for Geekitygeek

Hey guys, I'm sorry if this comes off as a rant; i should probably not be posting angry :/ Is it just me, or do you find your patience stretched rather thin when posting here at Daniweb sometimes? Because lately, i have. It doesn't bother me if someone doesn't understand …

Member Avatar for Geekitygeek
0
269
Member Avatar for yamini222

If the textbox holds other data as shown here then i would definitely recommend the [URL="http://msdn.microsoft.com/en-us/library/6f7hht7k.aspx"]regex[/URL] route. A regular expression like [iCODE]M/z= (?<Mz>\d*?\.\d*?), P= (?<P>\d*?\.\d*?)\%, Rel\. Int\.= (?<Rel>\d*?\.\d*?)\%[/iCODE] uses named capture groups to extract all three values into a single regex match. You use Match.Groups["GroupName"] to read them back.

Member Avatar for yamini222
0
126
Member Avatar for nssltd

Check out [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.scripterrorssuppressed.aspx"]WebBrowser.ScriptErrorSuppressed[/URL] property

Member Avatar for nssltd
0
103
Member Avatar for andisheh1362

Firstly, please do not attach your question to old threads. Your question is only vaguely related to the OP's question and this thread was 4 years dead. I assume you are trying to pass your double* to a method. Does the method require a pointer or a double as input? …

Member Avatar for andisheh1362
0
161
Member Avatar for Usmaan

A static member exists even when the class has not been instantiated. For instance: [CODE] class myClass { public myClass() { myString = "Not Static"; } public static string getStaticString() { return "Static"; } private string myString; public string getString() { return myString; } } public partial class Form1 : …

Member Avatar for Geekitygeek
1
150
Member Avatar for GAME

Also, i realise you aren't going to use your code. But for future reference, if you are going to remove items from a collection in a for loop you should always start at the highest index and work back to zero. Otherwise, when you remove an item, the indexes all …

Member Avatar for Geekitygeek
0
95
Member Avatar for sam1

If it is hidden client side using CSS or visual styles then you could try parsing the WebBrowser.Document to look for the button in HTML. If they are setting the control to hidden server side then it doesnt exist on the page until the page posts and reloads. If this …

Member Avatar for Geekitygeek
0
100
Member Avatar for IDC_Sharp

Solvers will post when they can..we aren't paid to answer at your beck and call so be patient. Buping your thread like this will only make it less likely that you will receive help

Member Avatar for Geekitygeek
0
162
Member Avatar for drake10k

The coordinate you give when creating a rectangle sets the top left corner. If the user drags a square from bottom to top or right to left then the first clicked location wont necesarrily be the top left corner. If you compare the X and Y values of the lastPoint …

Member Avatar for Geekitygeek
0
133
Member Avatar for TANK0814

Just to clarify, you want to set the text in one row based on the text in another. Something like: [CODE] if(subItemTexts[0] = "103, 1") subItemsText[5] = "Advanced Sheet" [/CODE] If not, can you calrify what you're trying to accomplish

Member Avatar for Geekitygeek
0
95

The End.