472 Posted Topics

Member Avatar for nertos

Here is another way that loops through the forms control collection to find the given control by it's name and passing in the form's control collection ([icode]this.Controls[/icode]) since you already added it to the collection ([icode]this.Controls.Add[/icode]): [code=csharp] public static bool EnableControl(System.Windows.Forms.Control.ControlCollection controls, string name, bool enable) { foreach (Control c …

Member Avatar for nertos
0
354
Member Avatar for fdsaasdf

It looks like you are creating a new row, but you are calling [icode]Update[/icode] (missing UpdateCommand though too for that): [URL="http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.updatecommand(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.updatecommand(VS.71).aspx[/URL] For inserting a new row, you need to specifiy an InsertCommand: [URL="http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.insertcommand(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.insertcommand(VS.71).aspx[/URL]

Member Avatar for DdoubleD
0
191
Member Avatar for fazeleh

You might want to check into the MS reference source server for the latest source available for VS 2008. You must follow all of the instructions. It will add some overhead to the start of your debug session, but once you are satisfied with the code already downloaded to your …

Member Avatar for DdoubleD
0
103
Member Avatar for mstrop

See if this article meets your needs: [URL="http://www.codeproject.com/KB/dotnet/XDMessaging.aspx"]alternative to .NET Remoting based on low-level Windows Messaging...[/URL]

Member Avatar for mstrop
0
231
Member Avatar for wiselka

First, change this post to NOT be a snippet because that is not what a SNIPPET is for! Where it asks for "What are you posting?", just use the default: Forum Thread

Member Avatar for sknake
0
193
Member Avatar for Fire_Michel

[code=csharp] Button[] btnsAry = (Button[])FindControlsOfType(/*this*/ form1, typeof(Button)); foreach (Button btn in btnsAry) btn.BackColor = Color.Red; [/code] Or, you could use a list (List<>): [code=csharp] List<Control> btnList = ListControlsOfType(/*this*/ form1, typeof(Button)); foreach (Button btn in btnList) btn.BackColor = Color.Red; [/code]

Member Avatar for Fire_Michel
0
152
Member Avatar for Calaesto

[QUOTE=Calaesto;1053698]Hi, No excuses: my problem is that I can't get my code to check if a certain record exists in a MSA database. My code needs to check if the database contains a row where 2, 3 or 4 specified fields exist. But, as mentioned, at the moment it only …

Member Avatar for Calaesto
0
1K
Member Avatar for plastic
Member Avatar for DdoubleD
0
524
Member Avatar for EcklerPa2

Just add the cast explicitly: [code=csharp] MouseEventArgs ee = (MouseEventArgs)e; [/code]

Member Avatar for DdoubleD
0
328
Member Avatar for Mitja Bonca

Unfortunately, I don't think there a simple answer to this problem. I ran into this thread where a number of people reported problems and a "wild goose chase" ensued trying to pinpoint the problem. So, the thread is quite lengthy, but if you take the time to read through it, …

Member Avatar for DdoubleD
0
358
Member Avatar for tincho87

[QUOTE=tincho87;1053558] [COLOR="Red"]C:\test\app.exe C:\plugin.dll C:\functions.dll[/COLOR] It doesn't work. [/QUOTE] In the above scenario, have you tried running the app with "C:\" in your PATH environment settings? It's not clear to me how your app is able to find and load the plugin.dll, but not the other. Could it be that the …

Member Avatar for tincho87
0
154
Member Avatar for chromatinpt

In form1, you have defined a [icode]get[/icode] property setter to retrieve the string value, which you can do from form3. However, if you want to set the value of the textbox control on form1 from form3, you need to create a setter [icode]set[/icode] property too. The typical way to do …

Member Avatar for chromatinpt
0
126
Member Avatar for Mitja Bonca

It's really a simple concept once you get a grasp on why you want to do this. Although you might have already considered this, I would expand the design to ensure that the presentation layer is also separated. The idea is to reduce the overall maintenance and increase the scalability …

Member Avatar for Mitja Bonca
0
236
Member Avatar for whee

I hesitated replying to this because I haven't actually used the FileSystemWatcher, though I am somewhat familiar with it. I'm a little confused what you are asking. Are you saying that when you change the file that FileSystemWatcher doesn't see the change, or are you wanting it to throw an …

Member Avatar for whee
0
91
Member Avatar for bravo659

Comments: In your btnAdd_Click event: [code=csharp] private void btnAdd_Click(object sender, EventArgs e) { //execute the counter as incrementor Counter++; //declare variable as integer int arrayCounter; //compare the counter less than 20 if (Counter <= 20) { //then arrayCounter will either add or equal to 1 arrayCounter = Counter += 1; …

Member Avatar for Geekitygeek
0
2K
Member Avatar for DdoubleD

[B]Overview:[/B] Oddly enough, MS never created a TreeViewDrowDown or equivalent. What I mean, is a control that looks and acts like a [icode]ComboBox[/icode], but contains a [icode]TreeView[/icode] instead of just a list when in the expanded drop-down mode. I've never understood why they haven't, but I always seem to want …

Member Avatar for Diamonddrake
1
1K
Member Avatar for Diamonddrake

All I did was look at this post and I hear sirens outside--just kidding. :D I can't wait to hear about everyone's experience once 7 has been out there a while... Out of curiosity, unless it is intended for network upgrades, what is the effective advantage of automating this?

Member Avatar for DdoubleD
0
105
Member Avatar for Mitja Bonca

More information is needed: 1) structure of Employee 2) structure/contents of the DataSet returned by: [icode]DataBaseLayer.GetAllEmployees();[/icode]

Member Avatar for DdoubleD
0
2K
Member Avatar for CanYouHandstand

[QUOTE=adatapost;1052086]?Is it possible to use it to pass an unspecified number of arrays of objects? Yes you can do this. [code] void methodName(params object []v){ ... } [/code][/QUOTE] adatapost pretty much gave you the way to do this. Here is an example of manipulating the variable arguments of object should …

Member Avatar for CanYouHandstand
0
1K
Member Avatar for epicasian

I would learn both if I were you. I programmed in C/C++ for several years, and I will tell you that once I started coding in C#, I really don't like looking at C/C++ code anymore, but I can and do mostly for code conversions...:) As far as which one …

Member Avatar for RoyMicro
0
176
Member Avatar for RoyMicro

Hey Roy. I'm a little new to using the report controls shipped with VS, but they make life so much easier I think. Anyway, I want to see what recommendations others might make for you. In the meantime, you could search the web for "CrystalReportViewer C# tutorial", or various other …

Member Avatar for RoyMicro
0
165
Member Avatar for Voulnet

Ignorant of the subject am I (definately not my forte) , but it sounds like you might need to write your own device driver to emulate the device. I might not be giving you any information here you haven't already considered; however, I ran across these links and figured I …

Member Avatar for Voulnet
0
3K
Member Avatar for chromatinpt

Create a public method in your Form1 to access the control's text, then from the child form, just up-cast your MdiParent to Form1 and access the method: [code=csharp] // defined in Form1, or the MdiParent form... public void SetStatusLabelText(string s) { toolStripStatusLabel.Text = s; } // to call from child …

Member Avatar for chromatinpt
0
188
Member Avatar for mr.white

This is a pretty good article as far as comparing Windows Forms to WPF at a high level: [URL="http://windowsclient.net/wpf/white-papers/when-to-adopt-wpf.aspx"]DECIDING WHEN TO ADOPT WINDOWS PRESENTATION FOUNDATION[/URL] To find examples of some technologies you are interested in, try looking on CodeProject.com and CodePlex.com.

Member Avatar for DdoubleD
0
221
Member Avatar for RoyMicro

I suppose the main thing you are giving up is streamlined maintenance and scalability since you will need to manually copy and paste (or perhaps remove) segments of code anytime the size of the container gets changed. Why are you avoiding loops?

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

To obtain the size of your list: [icode]properties.Count[/icode]. To access a member of [icode]Property[/icode] named [icode]pos[/icode] in a loop: [code=csharp] for (int i=0; i<properties.Count; i++) { if (player1pos == properties[i].pos) { // but, this will error (using i+1) if "i" is already at Count-1: player1pos = properties[i+1].pos; x = x …

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

Are you asking how to find particular menu items, and then enable/disable menu items? Or, is your question more general about how to design user permissions into the menu design?

Member Avatar for DdoubleD
0
591
Member Avatar for Dum_

Here is a good link to get you started: [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx"]http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx[/URL]

Member Avatar for Geekitygeek
0
181
Member Avatar for brightsolar

Wow is right! As Ryshad suggested, you could do this without the array altogether. However, if you must use an array as part of the requirements, I would suggest using an array to represent the monetary denominations instead of a 1 to 1 representation of 0.00 - 1.00. For example: …

Member Avatar for Geekitygeek
0
99
Member Avatar for RoyMicro

If you intend to parse or convert the byte[] into its string equivalents, the [icode]StreamWriter[/icode] should work fine as long as long as it does not need to be thread safe. For thread safety, look at [icode]TextWriter[/icode]. If you just want to write the byte[] to a file, look at …

Member Avatar for Geekitygeek
2
191
Member Avatar for Calaesto

Check the command text/query pass into the [icode]SqlCommand[/icode], which is what it is complaining about, but error doesn't show until you execute the command with [icode]ExecuteNonQuery[/icode]: [code=csharp] // // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlCommand class // with the text of the query and a System.Data.SqlClient.SqlConnection. // …

Member Avatar for DdoubleD
0
90
Member Avatar for LiamOB

Problem is that in your string ("22.925507, 0.0000000, 0.0000000, "), the [icode]Split[/icode] has created a last item equal to a " " (space char), which the [icode]Convert.ToDouble(" ")[/icode] yields the exception. To correct, remove the trailing (last) comma. As an alternative, change line 20 (or similar check for spaces) to …

Member Avatar for DdoubleD
0
549
Member Avatar for ITech

[QUOTE=hu_yang;1052094]You can try the following link , it shows the basics of sending date paramter to Crystal Reports in C#. [url]http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-date-parameter.htm[/url] [/QUOTE] Follow the link yang gave you above. I would: 1) create two date parameter fields for the begin and end dates, then 2) use the Record Selection Formula …

Member Avatar for DdoubleD
0
477
Member Avatar for EvolutionFallen

It would be a little difficult to explain ALL your options without knowing more about the C++ module and what you are supposed to do for this project... Here is some blogs with similar discussions: [URL="http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/ca03a370-4836-42ef-9912-6e9c45aa480c"]accessing C++ from C# gui...[/URL] [URL="http://stackoverflow.com/questions/1247968/fast-c-program-c-gui-possible"]Calling exported C functions...[/URL] [URL="http://www.gamedev.net/community/forums/topic.asp?topic_id=500289"]C++/CLI library...[/URL]

Member Avatar for DdoubleD
0
863
Member Avatar for avirag

avirag, this will import your excel data into a DataSet. If you need additional help writing the DataSet to Access table, please create another thread. Play with this and see if it works for you... [code=csharp] // NOTE: adaptor always returned error without full path of .xls file string connStr …

Member Avatar for DdoubleD
0
289
Member Avatar for Daniel_Crouse

The first thing you need is a database--do you have one? Then, you need to build a proper connection string to connect to it with: [URL="http://www.connectionstrings.com/"]http://www.connectionstrings.com/[/URL]. How you proceed from here depends on the database type, but the basic, most common stuff, involves: 1) Opening a connection 2) Building a …

Member Avatar for Daniel_Crouse
0
128
Member Avatar for NeenuThomas

You might find this link helpful: [URL="http://www.codeproject.com/KB/cs/Trial_Maker.aspx"]http://www.codeproject.com/KB/cs/Trial_Maker.aspx[/URL] For Setup: [URL="http://www.codeproject.com/KB/install/msinetserial.aspx?display=PrintAll"]http://www.codeproject.com/KB/install/msinetserial.aspx?display=PrintAll[/URL] [URL="http://www.daniweb.com/forums/thread224137.html"]http://www.daniweb.com/forums/thread224137.html[/URL] [URL="http://www.codeproject.com/KB/install/easysetup.aspx?msg=1973769"]http://www.codeproject.com/KB/install/easysetup.aspx?msg=1973769[/URL] -- search for [B]SerialNumberTemplate[/B] in article...

Member Avatar for NeenuThomas
0
148
Member Avatar for Jaydenn

I searched my registry and found the following key, which returned 1.6.0_15 on my machine: [code=csharp] RegistryKey rk = Registry.LocalMachine; RegistryKey subKey = rk.OpenSubKey("SOFTWARE\\JavaSoft\\Java Update\\Policy"); string currentVerion = subKey.GetValue("InstalledJREVersion").ToString(); [/code] EDIT: If using the above, just concatenate the [icode]currentVersion[/icode] to the "Jdk version: " text: [icode]Text = "Jdk version: " …

Member Avatar for sanch01r
0
155
Member Avatar for botaxsmaniz

[QUOTE=chandru7;1050185]can't select or can't see,after datasource bind the data [CODE]DG1.DataSource=ds;DG1.DataSource="Material";DG1.DataSource=ds; DG1.DataSource="Material"; DG1.DataBind(); [/CODE][/QUOTE] In the above, your DataSource will contain the last object set: [CODE]DG1.DataSource=ds;DG1.DataSource="Material";DG1.DataSource=ds;[/code] will result in: [CODE]DG1.DataSource=ds;[/code] which is back to your original code... Try: [code=csharp] DG1.DataSource=ds.Tables[0]; [/code] And, for programmatically selecting rows, use a currency manager: [code=csharp] …

Member Avatar for DdoubleD
0
934
Member Avatar for valter

Take a look at these similar links and loading images on separate thread: [URL="http://www.daniweb.com/forums/thread213640.html"]http://www.daniweb.com/forums/thread213640.html[/URL] [URL="http://www.daniweb.com/forums/thread210875.html"]http://www.daniweb.com/forums/thread210875.html[/URL] [URL="http://msdn.microsoft.com/en-us/library/8xs8549b.aspx"]http://msdn.microsoft.com/en-us/library/8xs8549b.aspx[/URL]

Member Avatar for valter
0
121
Member Avatar for jk8204

The [icode]SaveFileDialog[/icode] facilitates the selection of filename and path to save the file, but you must perform the actual write of the data. See [URL="http://msdn.microsoft.com/en-us/library/sfezx97z.aspx"]How to: SaveFileDialog[/URL].

Member Avatar for DdoubleD
0
154
Member Avatar for sidd.
Re: line

It is not clear to me what you are doing with this line and how you want it to expand and shrink. Can you provide the code with comments, or some images that represent the desired outcome?

Member Avatar for Geekitygeek
0
104
Member Avatar for cstrachan

Not sure if this is your problem, but the documentation indicates you should create the event source during installation of the application: [QUOTE]Create the new event source during the installation of your application. This allows time for the operating system to refresh its list of registered event sources and their …

Member Avatar for DdoubleD
0
110
Member Avatar for TheCodeHunter

First of all, use CODE tags: &#91;code=csharp&#93; ...code here.... &#91;/code&#93; Secondly, how is this a C# question, as your title suggests, when the code you have included is VB?

Member Avatar for Nick Evan
0
94
Member Avatar for Alicito

You didn't mention the actual error, but at first glance, it appears you never allocate your array, [icode]arr[/icode], before attempting to assign the values inside your constructor. Try allocating it first in the constructor: [code=csharp] arr = new int[s]; [/code]

Member Avatar for DdoubleD
0
140
Member Avatar for Mitja Bonca

Why do you want to reuse these id's once deleted--why does it matter? I would suggest that if your code is dependent upon id's being in consecutive order and gap free, that you might have a design flaw to begin with. If you are insistent upon pursuing this, check out …

Member Avatar for DdoubleD
0
165
Member Avatar for sanch01r

I don't have a LDAP server to play with. Here is an example of how to populate the child nodes using [icode]DirectoryEntry[/icode] component that might help you: [code=csharp] TreeNode users = new TreeNode("Users"); TreeNode groups = new TreeNode("Groups"); TreeNode services = new TreeNode("Services"); treeView1.Nodes.AddRange(new TreeNode[] { users, groups, services }); …

Member Avatar for DdoubleD
0
177
Member Avatar for emilio

In this example, the [icode]CellValueChanged[/icode] event is used to examine the cell when the value is changed. For your question, extract the code you need and just substitute the row and column indexes to refer to the known cell, which will allow you to "get" or "set" the [icode]Value[/icode] property …

Member Avatar for emilio
0
280
Member Avatar for brightsolar

Here is an example for your messagebox question in which the ArrayList is cast to an Array, which the [icode]string.Format[/icode] method can then use to format a string with individual placeholders (eg. {0}, {1}, etc.): [code=csharp] ArrayList ary = new ArrayList(); ary.Add("one"); ary.Add("two"); ary.Add("three"); string s = string.Format("{0}\r\n{1}\r\n{2}\r\n", ary.ToArray()); MessageBox.Show("My …

Member Avatar for brightsolar
0
159
Member Avatar for rutaba

It sounds like you want to start with very basic examples of creating a project/application. Try searching the web for keywords like: "hello world c#" "DB tutorial c# .NET" where DB is the type you are interested, such as "SQL Server" or "Access" There are many websites out there that …

Member Avatar for DdoubleD
0
187

The End.