Guest User

Button Creation

a guest
Mar 22nd, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | Fixit | 0 0
  1. private void populateDashboardButtons()
  2. {
  3.  
  4. //Connect to MongoDB, Grab Buttons
  5. MongoDBConnection mongoConnection = new MongoDBConnection();
  6. var dashboardButtons = mongoConnection.ReadButtons("USERID");
  7.  
  8. //Loop Through each button in list
  9. foreach ( var button in dashboardButtons )
  10. {
  11. //add buttons to form (dashboard)
  12. if (flowLayoutDasboardButtons.Controls.Count < 0)
  13. {
  14. flowLayoutDasboardButtons.Controls.Clear();
  15. }
  16. else
  17. {
  18.  
  19. flowLayoutDasboardButtons.Controls.Add(button);
  20.  
  21. }
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment