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
  1. Home
  2. General Programming
  3. C#
  4. VSTO Excel buttons

VSTO Excel buttons

Scheduled Pinned Locked Moved C#
databasehelpquestionlounge
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Drew McGhie
    wrote on last edited by
    #1

    I'm having an issue in an Excel project I'm doing with VSTO. Buttons that are not initially displayed when the page is loaded, do not become "active" when they are scrolled to. They look slightly fuzzy and bolded, but do not "click," they just sit there. There is a lot of stuff going on in the VSTO document(calls to a db to save/fill data, dynamic calculation, etc), and I think this might be causing my issue To see what I'm talking about(slightly), create a new vsto project and paste this into sheet1 private void Sheet1_Startup(object sender, System.EventArgs e) { Globals.ThisWorkbook.Application.DisplayAlerts = false; string name; for (Char x = 'A'; x <= 'Z'; x++) { name = "Button" + x.ToString(); Controls.AddButton(this.Range[String.Format("{0}1", x), missing], name); Button b = (Button)this.Controls[name]; b.Click += new EventHandler(b_Click); b.Text = name; } } void b_Click(object sender, EventArgs e) { Button B = sender as Button; Random r = new Random(); String bStr = B.Text.Substring(6); for (int iii = 2; iii < 200; iii++) { this.Range[String.Format("{0}{1}", bStr, iii.ToString()), missing].Value2 = r.Next(100); } } Anywho, what this does is put a large row of buttons across the top of a screen, and when pressed, populates a lot of data below it(random numbers, hopefully to simulate(in a way) the load my program creates). once there is a lot of data, try scrolling down and up and notice that as the buttons come on screen, they are briefly "fuzzy" before they turn normal. Has anyone encountered this before and know why this "refresh" might be suppressed?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

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