698 Posted Topics

Member Avatar for NH1

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

Member Avatar for Geekitygeek
0
298
Member Avatar for bbman

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 …

Member Avatar for Geekitygeek
0
123
Member Avatar for erfanjan

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 …

Member Avatar for Geekitygeek
0
141
Member Avatar for KathySbeat

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

Member Avatar for bubbling bubble
0
117
Member Avatar for scothy

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]

Member Avatar for scothy
0
3K
Member Avatar for pw_jamison

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 …

Member Avatar for pw_jamison
0
106
Member Avatar for =OTS=G-Man
Member Avatar for alicepriya

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.

Member Avatar for Geekitygeek
0
110
Member Avatar for anitha10
Re: C#

without seeing your code its very hard to see what you might need to change. Please post any code relevant to your question in [noparse][CODE][/CODE][/noparse] tags.

Member Avatar for taylby
0
105
Member Avatar for Usmaan

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 …

Member Avatar for Geekitygeek
0
198
Member Avatar for lgriess

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 …

Member Avatar for Geekitygeek
0
588
Member Avatar for brainbox

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?

Member Avatar for Geekitygeek
0
417
Member Avatar for JOSheaIV

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

Member Avatar for Geekitygeek
0
3K
Member Avatar for anitha10
Re: C#

check out the MDIChildren collection of the parent form. From this collection you can access the members of your child forms. As an aside, its generally polite to ask for help rather than demanding a solution.

Member Avatar for anitha10
0
204
Member Avatar for ia2196

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 …

Member Avatar for ddanbe
0
100
Member Avatar for azfarhus

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.

Member Avatar for PierlucSS
0
91
Member Avatar for DaveTran

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 …

Member Avatar for DaveTran
0
395
Member Avatar for judithSampathwa

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 …

Member Avatar for Geekitygeek
0
141
Member Avatar for Zinderin

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 …

Member Avatar for Geekitygeek
0
187
Member Avatar for hirenpatel53

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 …

Member Avatar for Geekitygeek
0
84
Member Avatar for judithSampathwa

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.

Member Avatar for Geekitygeek
0
222
Member Avatar for judithSampathwa

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.

Member Avatar for Geekitygeek
1
179
Member Avatar for chuck577

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 …

Member Avatar for Geekitygeek
1
376
Member Avatar for drake10k

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.

Member Avatar for farooqaaa
0
142
Member Avatar for Umee001

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]

Member Avatar for Umee001
0
187
Member Avatar for ITStrawberry

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 …

Member Avatar for Geekitygeek
0
107
Member Avatar for avi_d59

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 …

Member Avatar for Geekitygeek
0
116
Member Avatar for normmy

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

Member Avatar for Geekitygeek
0
258
Member Avatar for calnastic

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 …

Member Avatar for Geekitygeek
0
82
Member Avatar for ecoloney

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

Member Avatar for Geekitygeek
0
96
Member Avatar for buster2209

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 …

Member Avatar for buster2209
0
295
Member Avatar for buster2209

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]

Member Avatar for Geekitygeek
0
139
Member Avatar for NH1

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.

Member Avatar for Geekitygeek
0
122
Member Avatar for NH1
Member Avatar for Geekitygeek
0
274
Member Avatar for Usmaan

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

Member Avatar for Geekitygeek
0
131
Member Avatar for skamranj

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 …

Member Avatar for skamranj
0
140
Member Avatar for NH1

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.

Member Avatar for NH1
0
146
Member Avatar for MaiHunDown
Re: C#

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 …

Member Avatar for euroazn
0
87
Member Avatar for Jaydenn

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 …

Member Avatar for Jaydenn
0
222
Member Avatar for valter

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 …

Member Avatar for Geekitygeek
0
103
Member Avatar for Jaydenn

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 …

Member Avatar for Geekitygeek
0
140
Member Avatar for Nivass

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

Member Avatar for Geekitygeek
0
112
Member Avatar for BLY

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 …

Member Avatar for BLY
0
120
Member Avatar for avi_d59

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 …

Member Avatar for Geekitygeek
-3
101
Member Avatar for avi_d59

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 …

Member Avatar for Geekitygeek
-2
410
Member Avatar for zerey02

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?

Member Avatar for Geekitygeek
0
97
Member Avatar for empyrean

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]

Member Avatar for Geekitygeek
0
114
Member Avatar for ITStrawberry

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.

Member Avatar for Geekitygeek
0
88
Member Avatar for LevyDee

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 …

Member Avatar for Geekitygeek
0
111
Member Avatar for GAME

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 …

Member Avatar for GAME
0
340

The End.