+ Reply to Thread
Results 1 to 4 of 4

Button only in correct position after moving userform screen

  1. #1
    Registered User
    Join Date
    05-06-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    3

    Button only in correct position after moving userform screen

    Hello all and greetings,

    I am experiencing something strange. I have an excel program/macro that allows someone to define a system. (I do some things with system modelling and am using excel to define the systems).

    A user can configure various application components. Each of these components has a row with a delete button, a position change button, a name button and a mapping button.
    Below the lowest row, I have made an add button that allows a user to add new rows.

    ApSj0Bn.png

    When this button is clicked for the first time, this happens:

    cjhp6Yk.png

    What should happens is that I should get an extra row and the addbutton is moved down 1 row. I coded this to delete the addbutton, and add a new row and a new addbutton on the correct position.

    However, when I now move the userform screen a little using the mouse, poof! Everything is ok. Also, if I move the userform before clicking the addbutton, there is also no problem. I tried using solutions with Repaint or Screenupdating, so for as to no avail.

    All buttons and events have been coded dynamically.
    In my code, an event listener is running in the background, I adapted that from this forum:
    http://www.mrexcel.com/forum/excel-q...control-6.html

    I would be happy to provide more information (code etc), if deemed necessary, but first I was curious if someone has seen this behaviour before and maybe can give me a straightaway answer!

    Thanks in advance!

    Note: I expected the images to be shown directly in the post, but I see there are only links. I hope they works.

    Edit: A sample file can be found here: https://dl.dropboxusercontent.com/u/...013_06_05.xlsm
    Is there no way to upload it to this site? I could not find the option...
    Last edited by Ketch; 05-06-2013 at 12:38 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: Button only in correct position after moving userform screen

    pROVIDE THE SAMPLE FILE

    rEGRADS
    CA Mahaveer Somani

  3. #3
    Registered User
    Join Date
    05-06-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Button only in correct position after moving userform screen

    Hi, I am bumping this thread as I currently have provided a sample file. I am still curious whether someone else experiences this behaviour as well and if someone has suggestions. Cheers!

  4. #4
    Registered User
    Join Date
    05-06-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Button only in correct position after moving userform screen

    I fixed the bug by doing the following in my code: which equals moving the screen back and forth. However, this is of course not a very good solution. I would still be happy to hear suggestions to this issue.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1