698 Posted Topics
Re: I think you guys may be confusing DataGridViewRows with DataRows. Datatables don't store formatting information because they aren't directly displayed. You need to set the background colour of the DataGridView's Row. I'd suggest looking at the CellFormatting event as it is only called against cells that are to be displayed. … | |
Re: The methods and properties exposed by standard controls are no different from the methods and properties you write in code. If you want an Add method then add one to your control: [CODE] public void Add (object Item) { myList.Items.Add(Item); } [/CODE] If the control you are creating is an … | |
Re: Firstly, please try not to resurrect old threads as this violates [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]daniweb forum rules[/URL]. Secondly, this is the C# board, if your problem is ASP.net related then you will have access to a better pool of knowledge and experience if you post it on the [URL="http://www.daniweb.com/forums/forum18.html"]asp.net board[/URL]. Lastly, if you … | |
Re: What exactly is your question? Is there a problem with your code; Does it not behave correctly? N.B Please try to limit your use of the red font for highlighting one or tweo words; Large blocks of red text are quite hard on the eyes | |
Re: You can use an integer counter appended to a string to generate unique names. Something like: [CODE] public partial class frmDynamic : Form int ID = 0; private void AddTextbox() { TextBox t = new TextBox(); t.Name = "TextBox" + ID.ToString(); //TextBox0, TextBox1, etc this.Controls.Add(t); ID++; //increment counter } [/CODE] | |
Re: Yes, you can attach the event handler yourself after you have added the control: [CODE] protected void Page_Load(object sender, EventArgs e) { Control myUserControl = (Control)LoadControl("MyControl.ascx"); PanelX.Controls.Add(myUserControl); myUserControl.SomeEvent += new SomeEventHandler(eventHandler_Method); } private void eventHandler_Method(object sender, EventArgs e) { //your code here } [/CODE] I have a little experience with … | |
Re: Can you show the code for your Video class? | |
Re: an [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.errorprovider.aspx"]errorProvider[/URL] is just a means of displaying errors to your user. Handle the textbox [URL="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.textboxbase.textchanged.aspx"]TextChanged event[/URL], check the values input and if it isn't valid the call the errorProvider.SetError() method to assign an error message to the textbox. | |
Re: If you want to do it properly you should look into [URL="http://en.wikipedia.org/wiki/Order_of_operations"]mathematical operator precedence[/URL]; if the user enters "2 + 3 * 4" and you parse it item by item you will get "2 + 3 = 5 * 4 = 20" when the correct mathematical answer should be "3 … | |
Re: Check out the info at msdn. You might be better to use a recursive search. If your control is hosted in a nested naming container then FindControl might not work. Also, have you tried debugging to check what your iframe's ID is? I've not done a lot of asp.net but … | |
Re: You are right, the question was a C# winforms one, it was also posted nearly four years ago. Try to avoid resurecting old threads. Is your checkbox column bound or unbound? | |
Re: [QUOTE=PierlucSS;1315924]If this validation step is done, on the cell edit event, you can get the row and column index in the properties of the event arg. To know if the number has been parsed correctly, you can simple verify the value of num. because the 'out' parameter means that it … | |
Re: If, by GUI, you mean Form, then you can check out [URL="http://www.daniweb.com/code/snippet298708.html"]my tutorial here[/URL] to see how to pass a reference to Form1 into Form2 allowing Form2 to pass data back to Form1. Alternatively, you can open Form2 modally using ShowDialog() and add a public property to Form2 that Form1 … | |
Re: Try putting square bracers around any table and field names (eg "[Domains]"); I'm not sure about the database you are using, but i know some database standards have DOMAIN as a reserved word. | |
Re: What is it you are trying to acheive exactly? Why do you want to store 3D coordinates in a 1D array? Each item in a 1D array will store a singel value. You could use a string to concatenate the coordinates and store them that way like: [CODE] string[] array … | |
Re: Read the error text. [QUOTE] 'Value' should be between 'MinDate' and 'MaxDate' [/QUOTE] You set [iCODE]ctl.MinDate = System.DateTime.Now.Date[/iCODE] so any cell with a date value before today will throw this error. What are you trying to acheive? If you want to prevent the user from entering a value prior to … | |
Re: I found [URL="http://www.albahari.com/valuevsreftypes.aspx"]the article here[/URL] very useful when i was trying to get my head around the value vs reference concept. Essentially, you are correct about them being like pointers. Lets break it down in code, see if it helps: [CODE] ReferenceClass myVariable; //create a space in memory to store … | |
Re: Add an unbound image column to the datagridview, set the required image, then in either the datagridview's CellClick (if you want the user to click anywhere in cell) or CellContentClick (if you want the user to click the image itself) events check for the Column Index of the cell clicked … | |
Re: Take a look at the [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.rowprepaint.aspx"]RowPrePaint event[/URL]. You can customise all or part of the way cells in a row are painted there. Just add code to paint the calednar image to the box in the relevant column. | |
Re: You need to switch around your conditions. You should check if the variable is null, [B]only[/B] if it is not null should you try to compare its value. | |
Re: Please read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]forum rules[/URL] and [U]keep things tidy[/U]. First, you ressurected a 4 year dead thread to ask a loosely related question and now you've posted a completely unrelated question in the same thread. Please start a new thread unless you have something [B]relevant[/B] to add to the current … | |
Re: farooq posted a link to [URL="http://www.farooqazam.net/crop-image-c-sharp-and-vb-net/"]his tutorial[/URL] on a similar thread that might be of help. | |
Re: You can pass the file path to the new form in its constructor: [CODE] public partial class frmPictureViewer : Form { public frmPictureViewer (string FilePath) { Image img = Image.FromFile(FilePath); pictureBox1.Image = img; } } [/CODE] Then call your new form with [iCODE]frmPictureViewer picViewer = new frmPictureViewer("some file path");[/iCODE] | |
Re: If you are using Show() rather than ShowDialog() to display the second form then you have the problem of the first form not knowing when to access the property of the second. I posted [URL="http://www.daniweb.com/code/snippet298708.html"]a tutorial[/URL] that shows how to pass a reference to Form1 into Form2 allowing Form2 to … | |
Re: The operators in C# have predefined behaviours when used against the certain types. When you define a custom type, you can also set the behaviour of these operators when applied to that type. Theres a nice run down of which operators can be overloaded and some examples [URL="http://www.csharphelp.com/2006/03/c-operator-overloading/"]here[/URL]. Shout if … | |
Re: If you dont want to split it the way Momerath showed and only want to extract the values [B]inside[/B] the opening and closing tags then you can use a regex match: [CODE] class Program { static void Main(string[] args) { Regex reg = new Regex("<(?<tagContent>.*?)>"); string SearchString = @"<span style=""color:Blue;"">Dim</span> … | |
Re: If you are creating two instances of the random class at the same time you will get the same numbers. The random class generates numbers based on a seed value. The seed value is based on the current system clock time so if you create two objects at the same … | |
Re: When you assign a Parent to a control you are setting a value to a property. If you wish to give your class a Parent you simply need to add a property named Parent: [CODE] public Control Parent { get; set; } //.net 3.0 or later shorthand property syntax [/CODE] … | |
Re: You could use the ItemActivate event. You can sepcify in the ListView properties whether the item has to be clicked once or twice to activate, then use the ListView.FocusedItem property to see which item currently has focus. Or you could set the MultiSelect property to false and use the SelectedIndex … | |
Re: Hi buster2209, please try to avoid duplicate posts, you have a thread active already with this question. Mark this as solved and i will post an answer in [URL="http://www.daniweb.com/forums/thread305688.html"]the existing thread.[/URL] | |
Re: Please mark this as solved so we can keep all the answers on [URL="http://www.daniweb.com/forums/thread305572-2.html"]your other thread[/URL]. Please try to avoid posting duplicate threads as it can result in confusion both for solvers and for anyone who reads the thread in the future looking for help. | |
Re: You still have an '!' in your group by clause: DaySchedule![Shift Code Monday] | |
Re: If you get stuck with part of a tutorial and get no feedback on the site, you can always post the section of code here and ask for help. There are plenty of solvers here who can explain the code for you :) | |
Re: I just noticed you have response.redirect so this is must be an ASP.net project. Be aware that the ButtonClick events are handled [B]after[/B] the page has loaded. Is it possible something in your page load is firing an event? Put a breakpoint at the start of your event code and … | |
Re: Be careful when using Math.Round, if you aren't familiar with how it works you may find some odd results. By default it uses [URL="http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx"]MidPointRounding.ToEven[/URL] which means that 4.5 would round to 4 not 5 as you might expect. Use the overloaded method to specify the MidPointRounding.AwayFromZero for the traditional rounding. | |
Re: Could you please elaborate. What do you mean by "done C#"? Do you mean you have mastered it, learned a little, finished the Microsoft Certifications for it? What do you mean by "do for more"? Are you looking for a new language to learn, or a new project to work … | |
Re: You need to remove some of the white space when you post your code. If you use VS, select the code you wish to post then press Shift + Tab to move it one tab closer to the left margin. Do this to take out the extra indents before posting … | |
Re: Your regex is looking for a group that ends in "\b\s" which is "first or last character of word followed by a space". Unless you have a blank space at the end of your string it wont match the last word. Replace the last section with an optional match that … | |
Re: Sorry, my post was a recommendation, you didn't need to repost your code this time. Try to avoid posting duplicate questions as it results in the help you get being split and its harder to keep track of where you are at. As I've posted some advise on [URL="http://www.daniweb.com/forums/showthread.php?p=1309364&posted=1#post1309364"]the other … | |
Re: Unfortunately you cannot refresh the panel without refreshing the background. You can try double buffering the image to precent the flicker. Check out [URL="http://www.codeproject.com/KB/GDI-plus/flickerFreeDrawing.aspx"]the project here[/URL]. | |
Re: Instead of trying to write the values from the reader to the Console, you need to assign them to their relevant variables (eg date, name, notes, etc). Also, you are trying to pass a variable into the Load method - [iCODE]p.LoadData([COLOR="Red"][U]56[/U][/COLOR]);[/iCODE] - but the method does not have any input … | |
Re: I refer you to [URL="http://www.daniweb.com/forums/post1308182.html#post1308182"]my answer to your other post[/URL]. Daniweb is a community forum to share knowledge and experience. To work together to solve problems and aid in one another's development as coders. It is not a one-stop-shop for your coding needs. Please attempt your project yourself then post … | |
Re: Hi Avi, welcome to Daniweb. The policy here is to help those who show an effort and help themselves. Rather than post a broad "I need code for this" question, please make an attempt at the project then post if you have problems with specific errors or coding techniques. I … | |
Re: Are both of your classes forms? Is checkedListBox1 on AddBook form, and if so, is it [B]that[/B] instance of checkedListBox1 you wish to rebind or do you have a second checkedListBox on the ListCommand class that you want to bind? | |
Re: You could take a look at the Application.OpenForms collection: [CODE] string OpenForms = ""; foreach (Form f in Application.OpenForms) { OpenForms += f.Name + ", "; } if (OpenForms.Length > 2) OpenForms = OpenForms.Substring(0, OpenForms.Length - 2); MessageBox.Show(OpenForms); [/CODE] | |
Re: To expand on what Alexpap said check out [URL="http://www.daniweb.com/code/snippet299495.html"]my tutorial[/URL]. It shows how to hide and then recall the current form when the second form is closed. | |
Re: Did you set the index before or after assigning the imagelist? Try setting it up the way nick.crane suggested; Add an empty imagelist to the form in the designer and tie it to the ListView. If you want to avoid an exception when trying to assign the index you can … | |
Re: You will struggle to make it an instant process; you will always have a delay based on your internet speed as the program needs to connect to the webpage and download the html. I did a couple of tests (far from exhasutive) and found that using a HttpWebRequet and HttpWebResponse … |
The End.