I have an arbitrary list of elements that I'm adding to a tableLayoutPanel (it was the first layout I came across that I could add elements to and it would be scrollable). For each element, I add the name of the element, with a TrackBar and a TextBox. (so three controls per row).
I want to link the TrackBar with the TextBox in a way where when I move the TrackBar, it changes the numeric value in the textBox to the value of the TrackBar (and ViceVersa).
I know how to add the Events for the two (+= new EventHandler(Scrolled)). The problem is all my elements are being added with the same EventName, so no matter which control I manipulate, i want the corresponding controls to change as well... I think this is OK, because I don't know how many of these elements I will have until runtime.
My question is this... inside the Scrolled method, how can I make elementScrollBar1 change elementTextBox1, and 2 -> 2, 3 -> 3, etc? The only things passed in are object sender, EventArgs events. Is what I'm trying to do possible? If so please help.
Nvidia App gets light theme, bug fixes, and support for more games by Taras Buria
Nvidia has released a new update for the Nvidia App on Windows. Version 11.0.4 is now available with a few changes, such as automatic theme switching with light mode support, Windows Narrator support, fixed bugs, and optimal settings for 12 new games.
With today's update, Nvidia App now supports light mode. You can switch between modes in settings or let the app follow the system settings (Windows still does not support automatic theme switching). To change the mode, go to Settings > Features > Theme.
In addition, Nvidia App now supports Windows Narrator. The system's native screen reader can now properly read aloud on-screen content to improve accessibility for those relying on assistive technologies.
Next, the list of games that Nvidia App can tune for optimal performance has been extended with 12 new titles:
Assassin's Creed: Shadows
Clair Obscur: Expedition 33
Deadlock
ELDEN RING NIGHTREIGN
Grand Theft Auto V Enhanced
Half-Life 2 with RTX
Indiana Jones And The Great Circle
inZOI
Monster Hunter Wilds
Split Fiction
The Last of Us Part II Remastered
The Elder Scrolls IV: Oblivion Remastered
Finally, Nvidia App 11.0.4 fixes the following bugs: Fixed an issue where DLSS-FG defaults to 2x irrespective of in-game setting when DLSS override model is set to "Latest” and Frame generation is set to “Use the 3D application setting".
Fixed an issue where the driver download could not be completed.
Fixed an issue where the recording bitrate setting was not saved.
Fixed an issue where HDR video colors were not encoded properly for HEVC and AV1 playback.
Fixed a bug where the in-game overlay was not accessible on the GeForce RTX 5070.
Fixed an issue where a PC reboot would reset microphone boost to an incorrect value.
Fixed an issue where Highlights summary window could not be disabled.
Various stability fixes.
You can download the Nvidia App from the official website. Full release notes are available here.
Question
zackiv31
I have an arbitrary list of elements that I'm adding to a tableLayoutPanel (it was the first layout I came across that I could add elements to and it would be scrollable). For each element, I add the name of the element, with a TrackBar and a TextBox. (so three controls per row).
I want to link the TrackBar with the TextBox in a way where when I move the TrackBar, it changes the numeric value in the textBox to the value of the TrackBar (and ViceVersa).
I know how to add the Events for the two (+= new EventHandler(Scrolled)). The problem is all my elements are being added with the same EventName, so no matter which control I manipulate, i want the corresponding controls to change as well... I think this is OK, because I don't know how many of these elements I will have until runtime.
My question is this... inside the Scrolled method, how can I make elementScrollBar1 change elementTextBox1, and 2 -> 2, 3 -> 3, etc? The only things passed in are object sender, EventArgs events. Is what I'm trying to do possible? If so please help.
Link to comment
https://www.neowin.net/forum/topic/610910-c-dynamic-event-handling/Share on other sites
21 answers to this question
Recommended Posts