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
M

Mikan23

@Mikan23
About
Posts
12
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Accessing Dynamically Added User Controls
    M Mikan23

    That worked great! Thank you both! *sigh of relief*

    C# winforms help tutorial question

  • Accessing Dynamically Added User Controls
    M Mikan23

    Its getting closer, I have added them and can access them to a point using the following: MonitorTab monitor = new MonitorTab(); monitor.Name = "Monitor" + MonitorTabs.TabPages.Count.ToString(); But I still can't access that control except using a foreach looping through the controls on the tab, which doesn't allow me to access the timer. Any suggestions?

    C# winforms help tutorial question

  • Accessing Dynamically Added User Controls
    M Mikan23

    That makes sense but I've never tried that before (somewhat new at this), could you demonstrate please? This is my current code. TabPage newMonitorTab = new TabPage(TabTitle); MonitorTabs.TabPages.Add(newMonitorTab); MonitorTab monitor = new MonitorTab(); newMonitorTab.Controls.Add(monitor); Thanks!

    C# winforms help tutorial question

  • Accessing Dynamically Added User Controls
    M Mikan23

    Sorry I wasn't clear enough. On each tab is a user control called Monitor. So if I have three tabs, then there are three Monitors. Monitor has various elements including a timer, a datagridview, a treeview, etc... since they are part of the same user control, they are all named the same. So for example, I want to set refreshTimer on Monitor on tab 2 (the currently selected tab). How would I access that refreshTimer. I have tried the following without success MonitorTabs.SelectedTab.Monitor.refreshTimer MonitorTabs.SelectedTab.refreshTimer MonitorTabs.TabPages[MonitorTabs.SelectedIndex].Monitor.refreshTimer Thanks

    C# winforms help tutorial question

  • Accessing Dynamically Added User Controls
    M Mikan23

    On my form (MainWindow) I have a TabControl called MonitorTabs. I programmatically add a tab to it for each user I want to monitor. Then I add a user control called Monitor that contains a group of controls including a timer (RefreshTimer) to that tab. From MainWindow, I call a function that needs to reset the interval on RefreshTimer on the currently selected tab. The number of RefreshTimers is dynamic, one for each User Control/Tab, and I don't know how to access any of them let alone the one that is currently selected. The timer is set to public, and still nothing shows up. Can anyone help?

    C# winforms help tutorial question

  • Accessing parts of identical use controls
    M Mikan23

    Either I don't understand your solution or I didn't explain myself very well. It works like this. on my form (MainWindow) I have a TabControl called MonitorTabs. I programmatically add a tab to it for each user I want to monitor like so: TabTitle = FirstName + " " + LastName; TabPage newMonitorTab = new TabPage(TabTitle); MonitorTabs.TabPages.Add(newMonitorTab); Then I add a user control called Monitor that contains a group of controls including a timer (RefreshTimer) to that tab like so: Monitor monitor = new Monitor(); monitor.Size = newMonitorTab.Size; monitor.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; monitor.UserID = UserID; newMonitorTab.Controls.Add(monitor); Then the function ends and other things happen. From the menu in MainWindow, I call a function that needs to reset the interval on RefreshTimer on the currently selected tab. There may be three RefreshTimers, one on each User Control/Tab, and I don't know how to access any of them let alone the one that is currently selected. The timer is set to public, and still nothing shows up. I hope this explains it better. Thanks for any forthcoming help

    C# question

  • Accessing parts of identical use controls
    M Mikan23

    I have a TabControl, and tabs can be dynamically added for users. When a tab is added, a user-control is added to that tab. So each tab has an identical user control, and each control is made up of a group of identical controls. I need to access those controls, in this case, a timer from the main window, but I cannot just use the name of the timer "refreshTimer". How would I access them? I have tried tabcontrolname.tabpages[selectedIndex].usercontrolname.refreshTimer.Start(); along with several other variations, but none of them have worked so far. Any suggestions?

    C# question

  • How to Add Data to a dataset and write to an xml file
    M Mikan23

    I have a dataset that I read from an xml file using DataSet.ReadXml(fs); I then add to the dataset and rewrite the xml file using the following: DataRow newrow = mf.quotesDataSet.Tables["quote"].NewRow(); newrow["thequote"] = quoteInput.Text; newrow["speaker"] = speakerInput.Text; newrow["origin"] = originInput.Text; newrow["image"] = "test.jpg"; mf.quotesDataSet.Tables["quote"].Rows.Add(newrow); mf.quotesDataSet.WriteXml(fw); It does add the data, however, it adds it outside the main xml hierarchy. For example, instead of: <rss> <channel> <quote><thequote>text</thequote></quote> <quote><thequote>text</thequote></quote> <quote><thequote>new text</thequote></quote> </channel> </rss> it writes to the file as: <rss> <channel> <quote><thequote>text</thequote></quote> <quote><thequote>text</thequote></quote> </channel> </rss> <quote><thequote>new text</thequote></quote> how do I make the added rows to the dataset write into the proper hierarchy?

    C / C++ / MFC tutorial question xml

  • Dataset WriteXML places rows added to dataset outside of main nodes
    M Mikan23

    I have a dataset that I read from an xml file using DataSet.ReadXml(fs); I then add to the dataset and rewrite the xml file using the following: DataRow newrow = mf.quotesDataSet.Tables["quote"].NewRow(); newrow["thequote"] = quoteInput.Text; newrow["speaker"] = speakerInput.Text; newrow["origin"] = originInput.Text; newrow["image"] = "test.jpg"; mf.quotesDataSet.Tables["quote"].Rows.Add(newrow); mf.quotesDataSet.WriteXml(fw); It does add the data, however, it adds it outside the main xml hierarchy. For example, instead of: <rss> <channel> <quote><thequote>text</thequote></quote> <quote><thequote>text</thequote></quote> <quote><thequote>new text</thequote></quote> </channel> </rss> it writes to the file as: <rss> <channel> <quote><thequote>text</thequote></quote> <quote><thequote>text</thequote></quote> </channel> </rss> <quote><thequote>new text</thequote></quote> how do I make the added rows to the dataset write into the proper hierarchy?

    C# question xml tutorial

  • Binding Dataset to DataGridView
    M Mikan23

    Its determined to stay with the fields in the dataset, so I tried your second suggestion from the original and renamed the fields in the dataset temporarily. This worked on the datagridview just fine, many thanks!

    C# tutorial wpf wcf xml question

  • Binding Dataset to DataGridView
    M Mikan23

    I'm working with the new Visual C# Express beta and the latest of the .Net 2 version. Unfortunately, they have replaced datagrid with datagridview, and datagridtablestyle does not seem to have a new version. Unfortunately, they also have not provided any documentation that I can understand for achieving the same effects. Any other thoughts? Thanks for the help either way.

    C# tutorial wpf wcf xml question

  • Binding Dataset to DataGridView
    M Mikan23

    I am attemping to bind the data from an xml file into a datagridview. I have achieved this via the following code: quotesDataSet.ReadXml(Properties.Settings.Default.XmlQuoteFile); quoteGrid.DataSource = quotesDataSet; quoteGrid.DataMember = "quote"; This automatically binds the four elements of the quote parent into four rows. However, from that point on, I cannot rename the header rows or control them in any way. I've tried everything from attempting to assign a datagridtablestyle, to simply using quoteGrid.Columns[1].HeaderText = "Text"; Can anyone provide me with a working example of how to achieve this?

    C# tutorial wpf wcf xml question
  • Login

  • Don't have an account? Register

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