698 Posted Topics
Re: It depends on what you want to acheive and why. You can't directly include vb.net code in a C# project. You can access teh vb code FROM your C# project in a couple of ways. How large is the vb.net page and do you use it in vb.net projects? The … | |
Re: Unfortunately the wildcard symbol (%) is only allowed at the start and/or end of the filter string. You would need to implement your own logic to apply the filter the way you have stated. Something like: [CODE] string Value = "M a"; string filter = string.Empty; if (Value.Contains(" ")) //check … | |
Re: pritesh...what you have suggested is completely wrong. HOW he used the '/' is absolutely right, it was WHERE he used it that is the problem. If EntryID is a numeric data type then it should not be enclosed as a string. The '/' is an escape sequence that ensures the … | |
| |
Re: You need to obtain a reference to form 1 within form 2. Check out [URL="http://www.daniweb.com/code/snippet298708.html"]my new tutorial[/URL] to see how you can create the reference and then use it to access controls on another form. | |
Re: You need to add items to the SelectedItems collection rather than chanign the single SelectedItem value: [CODE] foreach (object item in listBox1.SelectedItems) { listBox2.SelectedItems.Add(item); } [/CODE] | |
Re: Hi GAME, the policy here at daniweb is to help those who help themselves. nick.crane has outlined the process you need to follow; write a method which iterates through the forms stored in the MDIParent's MDIChildren collection and sets the location and size for each form according to your desired … | |
Re: check [URL="http://www.daniweb.com/code/snippet298708.html"]my new tutorial[/URL] since this seems to be a common problem :) | |
Re: You need to use the KeyUp and KeyDown events. The shift key doesnt fire the KeyPress event. The KeyUp and KeyDown events have an e.KeyData property which will hold a value you can check against the Keys enumeration: [CODE] if(e.KeyData== Keys.ShiftKey) [/CODE] | |
![]() | Re: Im not aware of a standard control that offers this functionality. There may be something in WPF or a third party control you could use. Alternatively you can add this yourself fairly easily using a timer. Add a tiemr to your form and in its Tick event reduce the size … ![]() |
Re: You can also attach your project in a zip file by clicking Use Advanced Editor and then the paperclip "attachments" button and adding the file. Then anyone can view your code and attempt to help you. This is a community site, where we all work together to solve problems and … | |
Re: finito is right, you need to actually multiply the number BY something. Is it possible you got confused by the alternative syntax of [iCODE]number*=number[/iCODE]? If you are operating on the same variable that will store the result you can use this as a shorthand. For example: [CODE] int number; number … | |
Re: Your second condition will never be true, you need to swap them around. The if statement starts at the first condition and works its way down until one matches. In your case if DDLDepartment.SelectedValue is not null it will match the first. The only way your else statement will be … | |
Re: finito and farooqaaa have it right between them. If you want to access members of Form1 from Form2 then Form2 needs to contain a refernce to Form1. Use the code he showed you to pass a reference in Form2's constructor. However, it is bad OO to directly access a member … | |
Re: arunkumars, what purpose does [icode]Login lg = new Login(); lg.Close();[/icode] serve? You create the form, run its constructor then dispose of it? If you were trying to obtain a reference to the existign Login form and close that one, this is not the way to do it. Since it seems … | |
Re: You have answered your own question really; each port needs to operate in its own thread. The only way you can have your application monitoring and answering on all the ports concurrently is to use a threaded approach. There are numerous tutorials and articles about threading...[URL="http://msdn.microsoft.com/en-us/library/aa645740(VS.71).aspx"]google[/URL] [URL="http://www.albahari.com/threading/"]is[/URL] [URL="http://www.yoda.arachsys.com/csharp/threads/"]your[/URL] [URL="http://www.codeproject.com/KB/cs/ThreadsinC_.aspx"]friend[/URL]. | |
Re: SQL?? SQL is used for database queries...are you sure thats what you need? | |
Re: the extra backslash is an escape character; it is used at the start of an escape sequence. An escape sequence is a series of characters which the compiler reads and converts into somethign else. For instance \n becomes a newline character. To tell the compiler that the '' is to … | |
Re: The inputbox is language specific and is not a feature missing from "VS" but the "C#" language. It is very easy to roll your own input box in C# which is something i did a while back and reuse. Just create a form with a label, a textbox and your … | |
Re: Firstly, please use [noparse][code][/code][/noparse] tags when posting code to preserve the formatting and make it readable. As to your problem, i believe it stems from calling cmd.ExecuteReader() twice. You load the data into your SqlDataReader, check it has rows then try to get the dataset again. You already have the … | |
Re: The UI thread cannot be directly accessed by other threads. You have invoke a delegate to perform the changes on the UI. Theres an example [URL="http://blogs.msdn.com/b/csharpfaq/archive/2004/03/17/91685.aspx"]here[/URL]. | |
Re: You can disable that shortcut in the registry. Theres a post that shows you how to do it [URL="http://tamaspiros.co.uk/2007/12/20/c-disable-ctrl-alt-del-alt-tab-alt-f4-start-menu-and-so-on/"]here[/URL] although this kind of thing always feels a little to "nasty" for my tastes : / Im sure its just me, there must be SOME genuine reason for preventing your user … | |
Re: If you want to use the loop approach then you should use a loop in your code. At the moment your code basically does this: Create file 0. If file 0 doesnt exist, increase loop and create file 0. (EDIT) Clearly not what you were aiming for. If you are … | |
Re: You have two choices. You can pass a reference to Form1 into Form2 in its constructor to allow you to pass the data back, or you can add a Result property to Form2 which you read from Form1 in order to update the status. Solution One Example: [CODE] public partial … | |
Re: Check your Output window in VS; Unless you have manually created the folder "C:\new2\newnew" you may find you have some entries that read "A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll" As nick.crane suggested, you need to re-examine your logic and your path strings...if you have the paths … | |
Re: Use nullable search parameters in your sql query: [CODE] declare @id int = 1 declare @Name nvarchar(20) = null SELECT * FROM Products WHERE (@id is null OR Products.ProductID = @id) AND (@Name is null OR Products.Name = @Name [/CODE] By making the search terms nullable and checking for null … | |
Re: At 20 days old, i'm not sure it was worth resurrecting this thread to have it marked solved | |
Re: What you are creating here is a parent child relationship between the two forms. When you create Form2 WITHIN Form1, Form2 is the child, Form1 is the parent. A word of Caution; whilst creating a child form then closing the parent form will often work...it is not good design practice … | |
Re: Google is your friend :p [URL="http://en.wikipedia.org/wiki/Sharable_Content_Object_Reference_Model"]SCORM[/URL] or the [URL="http://www.scorm.com/"]Home of Scorm[/URL] | |
Re: SHould just be [icode]if(myReader.HasRows)[/icode] | |
Re: You have a couple of choices. You can store the current file number somewhere so you can resume from that number, or you can loop through the numbers until you find the lowest that doesnt already exist. If you do the first you need to decide the scope of the … | |
Re: if you want an easy way to disable all of the controls you can group them together inside a panel. Set the panel's Enabled property to false and all of the controls inside it will be disabled too. If you leave the button outside the panel it will be uneffected. … | |
Re: Hi, When you say you want to check if they have been "stored more than x times", do you mean in the arraylist? If you are only allowing values to be stored if they havent been used then this check is redundant (unless you plan to populate the arraylist with … | |
Re: insert a breakpoint and debug to check what controls are present in this.Controls | |
Re: File.Copy or File.Move only work on a single file; you cannot specify "*" to get all files. If you want to move all files then you need to iterate through them manually: [CODE] DirectoryInfo source = new DirectoryInfo(@"C:\new1\"); DirectoryInfo destination = new DirectoryInfo(@"C:\new2\"); foreach (FileInfo file in source.GetFiles()) { file.MoveTo(Path.Combine(destination.FullName, … | |
Re: Please refrain from posting duplicate threads. I have answered your problem in your [URL="http://www.daniweb.com/forums/thread297665.html"]original question[/URL]. | |
Re: [QUOTE=GDICommander;1279694]Just put a try-catch with the correct exception, FormatException try { //Convert text boxes } catch (FormatException e) { Console.WriteLine("Invalid text in boxes!"); }[/QUOTE] An alternative to throwing an exception would be to utilise the TryParse method: [CODE] int a; if (int.TryParse(textBox1.Text, out a)) { //success. Do work } else … | |
Re: And whilst you are debugging, check that objSlides.Count is greater than zero :) | |
Re: When you say you have it repeated in ALL of the textchanged events do you mean something like: [CODE] private void textBox1_TextChanged(object sender, EventArgs e) { string l_text; l_text = textBox1.Text; l_text += textBox2.Text; l_text += textBox3.Text; ... } private void textBox2_TextChanged(object sender, EventArgs e) { string l_text; l_text = … | |
Re: Depending on how many forms you'll be working with and whether you want to maintain their state when moving between them, you could keep a List of the forms visited. If you want to maintain their state then (eg values in controls, changes made, etc) and you are using relatively … | |
Re: Agreed...ArrayList stores objects, if you want to use an ArrayList you will have to unbox them before using them: [CODE] //assuming you only store integer values in the arraylist if ((int)vector[j] > (int)vector[j + 1]) { int aux = (int)vector[j]; [/CODE] alternatively, as ddanbe suggested, if you only store the … | |
Re: If i have understood correctly you want each gridview to be shown when you click one of the nav buttons. You can do this with a TabControl; place each datagrid in a different page then show/hide the tab pages when the buttons are clicked. This is propably the simplest method, … | |
Re: Just so you know..the reason you were getting the error is because [iCODE]Image.Equals(object)[/iCODE] is used to determine if the current image object is equal to the object specified in the paramaters. ie, [iCODE]PicBox1.Image.Equals(bitMap1)[/iCODE] will return true if PicBox1.Image and bitMap1 are equal. In this sense 'equal' means they have the … | |
Re: You are passing in a filename as a string where the method signature expects a stream value. Either change the method to: [CODE] private void Blah(string path) { Stream s = new Stream(path); } [/CODE] Writing on the fly here so apologies if the stream syntax is off. Basically pass … | |
Re: I think you may have misunderstood the concept of pseudocode...you have the right idea, that non-programmers can read it and understand it, but that isnt its purpose. The idea is to write the pseudocode BEFORE you write your code. You use pseudocode to get a view of the flow of … | |
Re: Globals are a bad OO design, C# is an OO language. The module in vb.net is just a neat trick the compiler offers. The modules are basically just sealed classes with all their members declared as static. You can do the same yourself, you just don't promote the member names … | |
Re: When you zoom the image are you resizing the picture box to fit or is part of the image hidden outside the container? | |
Re: I'm not sure what it is you are trying to achieve : / That isnt Java script..its a segment of html. What are you trying to m,atch with your regex? Post some code so we can see what you're trying to do | |
Re: I noticed you use [icode]xlBook = xl.Workbooks.Open[/icode]; i'm certain i read somewhere that a general rule of thumb is two avoid "double dots" when using COM objects. When .net calls the com objects it creates a wrapper which ends up something like: [CODE] WorkBook xlBook; WorkBooks tmp; tmp = xlApp.Workbooks; … | |
Re: for (loop=0; i < MAX_TRIES; loop++) should be for (loop=0; [COLOR="Red"]loop[/COLOR] < MAX_TRIES; loop++) right? :) |
The End.