Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

Martin31088

@Martin31088
About
Posts
17
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Cut, Copy & Paste from variable text boxes
    M Martin31088

    Hi guys, What I'm trying to do is cut copy and paste the selected text from any text box in my application. I have it working if it copies the entire text from the box, and I have it working if I hard code the text box name into to function. Ive looked all over for an answer to this, and have got nowhere This is the current code I am using:

    string ActiveCon = this.ActiveControl.Name;
    string SelText = ActiveCon.SelectedText;
    Clipboard.SetText(SelText);
    this.ActiveControl.Text = "";

    It just does not like SelectedText used on a variable Any help on this would be greatly appreciated. Regards Martin

    C# help

  • Checking a registry key exists
    M Martin31088

    I've finally sorted it! I used some suggestions from your last post which helped. But I decided to tackle it from a different angle, eventually i came up with doing a valueCount If (Count != 3) { create the keys } then copy values of each. Works perfectly. Thanks alot for your support Henry Best regards Martin

    C# help windows-admin

  • Checking a registry key exists
    M Martin31088

    Thanks for the suggestion, I'll have to look at it tomorrow. I'll let you know how I get on. Thanks alot for your support Martin

    C# help windows-admin

  • Checking a registry key exists
    M Martin31088

    Currently It does run through the if regardless of whether the key exists or not. The way the code is at the moment (some changes have been made to the previous post) the key will get created if it does not exist. I can then make a change in the options of my application and apply them which saves the change to their respective keys. Then when I close the program and re-open it, the keys are reset back to the default because the code is running through the wrong part of my if statement and overwriting the key. Intended I would like it to be able to tell if the key exists, if it does not, create it, if it does, copy the value of each key into the defined global variables. So that program can use these values wherever necessary. I'll post the altered code if you need. I hope this clears it up. Thanks

    C# help windows-admin

  • Checking a registry key exists
    M Martin31088

    the other way around, if that key doesn't exist run the else part to create the key.

    C# help windows-admin

  • Checking a registry key exists
    M Martin31088

    Hi everyone, I'm writing a little application and I've hit a bit of a problem. part of the program uses the registry to store certain things. I have no problem writing or reading a key. But I need to be able to check the key exists, if it does do this, if not write the key. Here's the code I'm currently using: using Microsoft.Win32; RegistryKey MyRegKey = Registry.LocalMachine.OpenSubKey("software\\MyApp\\SaveData"); if (MyRegKey != null) { string OptCurrency = MyRegKey .GetValue("Currency").ToString(); } else { RegistryKey CreateMyRegKey = Registry.LocalMachine.CreateSubKey("software\\MyApp\\SaveData"); CreateMyRegKey .SetValue("Currency", 0); string OptCurrency = "0"; } MyRegKey.Close(); This is fine if the key exists, but doesn't recognise if it does not, and runs through the if rather than the else. Any help would be greatly appreciated Many thanks Martin

    C# help windows-admin

  • Javascript menu not working properly in Opera
    M Martin31088

    Afraid not, this is just development on our existing site.

    Web Development javascript

  • Javascript menu not working properly in Opera
    M Martin31088

    In the Head <script type="text/javascript"> <!-- function F_loadRollover(){} function F_roll(){} //--> </script> <script type="text/javascript" src="./assets/rollover.js"></script> <style type="text/css" title="NOF_STYLE_SHEET"> <!-- DIV#NavigationBar3_1LYR { position:absolute; visibility:hidden; top: 0; left: 0; z-index:1; } DIV#NavigationBar3_2LYR { position:absolute; visibility:hidden; top: 0; left: 0; z-index:1; } DIV#NavigationBar3_3LYR { position:absolute; visibility:hidden; top: 0; left: 0; z-index:1; } DIV#NavigationBar3_4LYR { position:absolute; visibility:hidden; top: 0; left: 0; z-index:1; } DIV#NavigationBar3_5LYR { position:absolute; visibility:hidden; top: 0; left: 0; z-index:1; } DIV#NavigationBar3_6LYR { position:absolute; visibility:hidden; top: 0; left: 0; z-index:1; } --> </style> In the body to display the parent menu items <code> <td width="139">                                                 <a href="javascript:void(0)" style="cursor:default; text-decoration:none;" onMouseOver="F_loadRollover('NavigationButton1','',0);F_roll('NavigationButton1',1)" onMouseOut="F_roll('NavigationButton1',0)">                                                       <img id="NavigationButton1" name="NavigationButton1" height="20" width="139" src="./assets/images/autogen/Core_Nbutton1_1.gif" onmouseover="F_loadRollover(this,'Core_NRbutton2_1.gif',new Array('NavigationBar3_1', 'vertical', 'fadeBottom', 0, 20))" border="0" alt="Core" title="Core" />                                                 </a>                                           </td>                                           <td width="139"> &nb

    Web Development javascript

  • Javascript menu not working properly in Opera
    M Martin31088

    Hi guys, I'm having difficulty displaying my navigation bar in Opera. It's a menu bar with rollover buttons and drop down menu. When a drop down item is clicked it changes the src of the iframe below. It's working perfectly in IE, Firefox and Chrome but not in Opera. The 6 parent menu items display, with working rollovers, but i get no dropdowns from any of them. I've looked through my opera settings and can't seem to find anything. If anyone has any suggestions as to why this would happen I would be very grateful to hear them. Best regards Martin

    Web Development javascript

  • Totaling and averaging column in datagridview [modified]
    M Martin31088

    Thanks alot, I knew it would be something simple like that.

    C#

  • Totaling and averaging column in datagridview [modified]
    M Martin31088

    Hi guys, I've got a windows form with a datagridview linked to an access database. The third column in the datagridview is a list of numeric values. On load up I would like a textbox to display the average of all the values in this column. Can't quite figure it out. Here's the code I have written: int Counter = 0; double AverageCalc = 0; while (Counter < datagridview.Rows.Count) { string Average = null; Average = datagridview.SelectedRows[Counter].Cells[2].Value.ToString(); AverageCalc = AverageCalc + Convert.ToDouble(Average); Counter++; } AverageCalc = AverageCalc / datagridview.Rows.Count; txtAverage.Text = AverageCalc.ToString(); It loops through once, and then fails at: Average = datagridview.SelectedRows[Counter].Cells[2].Value.ToString(); When Counter = 1 I'm not really sure what else to try, any advise would be greatly appreciated. Thanks Martin

    modified on Wednesday, April 8, 2009 9:24 AM

    C#

  • Loading data from selected row in datagridview into dialog box
    M Martin31088

    Thanks so much, that works beautifully. Not entirely sure exactly how it works, but I'll work it out hehe. Many thanks Martin

    C#

  • Button click in sub-dialog copy data onto main dialog
    M Martin31088

    Hey guys, I'd posted this question as a message in a thread that's been nudged down to page two, so not sure if anybody would read it. So I'll just re-ask here. I have a sub-dialog in which I have a datagridview that i can search through, select a row, and click load. When clicking load, the data from that selected row is saved as a public static string in a class, so i can use it in my main dialog. The problem I am having is that I can't figure out how to automatically populate the fields of the main dialog on the click of the load button in the sub-dialog. Any help greatly appreciated. Martin

    C#

  • Loading data from selected row in datagridview into dialog box
    M Martin31088

    Thanks alot for that. I've found a simpler way to get the cell value. I'm just getting the value from the datagridview with: class1.UserID = dtaSearchID.SelectedRows[0].Cells[0].Value.ToString(); I do that for all the cells in the selected row. The problem I have now is that I'm not asure how to automatically fill those details into the first dialog. I am able to do it when i manually trigger an event, ie. click another button. But I can't figure out how to do it on the click of the load button in my Search from. Any help greatly appreciated. Martin

    C#

  • Loading data from selected row in datagridview into dialog box
    M Martin31088

    Thanks. I've had a play with that previously, couldn't really figure out out to implement it though, I'll just keep going.

    C#

  • Loading data from selected row in datagridview into dialog box
    M Martin31088

    Hi everyone, I've got a dialog box with checkboxes, comboboxes and textboxes for filling in. I have it saving perfectly into my access database. On this dialog I have Load button, which opens a new dialog. This has a search textbox, a datagridview and a few buttons. The datagridview displays the contents of the database. I would like to be able to get the information in the selected row of the datagridview and load that into the original dialog. I have tried to figure it out myself, but my C# knowledge is limited. I don't really have any code for loading, but If i write anything i'll get it posted. Any direction in this would be greatly appreciated. Many thanks Martin

    C#

  • Searching within datagridview
    M Martin31088

    Hey everyone, I've got a datagridview linked to an access database with a seach function. It's working well, but with one problem. It only displays the row(s) when you search for the complete User Name. It would be a big time saver if the search would locate any row(s) which contains the txtSearchID, so you would not need to type out the whole user name every time. At the moment I am using: Command.CommandText = "SELECT * FROM Users WHERE [User ID] = '" + txtSearchID.Text + "'"; OleDbDataAdapter Adapter = new OleDbDataAdapter(Command); Adapter.Fill(ds); I'm sure theres a simple answer, just can't quite figure it out. Any help greatly appreciated Martin

    C# help database algorithms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups