none
controls.setsize not working? RRS feed

  • Question

  • the comments in the code explain all the attempts i've made to resize the control...

    GraphicsWindow.Width = 640
    GraphicsWindow.Height = 480
    GraphicsWindow.Left = (Desktop.Width - 640) / 2
    GraphicsWindow.Top = (Desktop.Height - 480) / 2
    
    'I EVEN REMARKED THIS LINE IN AN ATTEMPT TO RESIZE THE CONTROL
    'GraphicsWindow.CanResize = "False"
    
    GraphicsWindow.Title = "NEW"
    GraphicsWindow.BackgroundColor = "DarkBlue"
    GraphicsWindow.BrushColor = "Yellow"
    GraphicsWindow.FontName = "Veranda"
    GraphicsWindow.FontSize = 14
    GraphicsWindow.show()
    GraphicsWindow.Clear()
    
    tag01 = "C:\Users\Albert\Programming\Small Basic\Saved Projects\Small Lotto\Images\PowerBall.png"
    
    'Controls.AddButton("PowerBall", 64, 31)
    'THE CONTROL IS NOT RESIZING
    'Controls.SetSize("PowerBall", 223, 87)
    
    'THE CONTROL IS NOT RESIZING
    Controls.SetSize("PowerBall", 223, 87)
    Controls.AddButton("PowerBall", 64, 31)
    
    
    'THE IMAGE IN NOT COVERING THE CONTROL
    GraphicsWindow.DrawResizedImage(tag01, 64, 31, 223, 87)
    
    
    'THE CONTROL IS NOT RESIZING
    'Controls.SetSize("PowerBall", 223, 87)
    'Controls.AddButton("PowerBall", 64, 31)
    
    'Controls.AddButton("PowerBall", 64, 31)
    'THE CONTROL IS NOT RESIZING
    'Controls.SetSize("PowerBall", 223, 87)

    am i doing something wrong?

    Well, I feel a whole heck of a lot more like I do now than I did a little while ago!!?!

    Thursday, June 7, 2012 5:50 PM

Answers

  • No I don't think so without an extension - my extension does have a method LDShapes.SetImage(buttonPowerBall,tag01) that can do this.

    The download for this extension can be found here, just hit the download icon to the right of the LitDev extension.

    • Marked as answer by Namyegob Thursday, June 7, 2012 7:46 PM
    Thursday, June 7, 2012 6:52 PM
    Moderator

All replies

  • You need to store the control in a variable and use this as the resize argument:

    tag01 = "C:\Users\Albert\Programming\Small Basic\Saved Projects\Small Lotto\Images\PowerBall.png"
    buttonPowerBall = Controls.AddButton("PowerBall", 64, 31)
    Controls.SetSize(buttonPowerBall, 223, 87)

    Thursday, June 7, 2012 6:01 PM
    Moderator
  • well, that works! thanks Lit!!  but i have no earthly clue as to why it didn't work the other way...  i'm getting hungry, and it's only because this project is eating my lunch!!  lol.  can i cover the button with the image? or can i incorporate the image onto the face of the button?

    Well, I feel a whole heck of a lot more like I do now than I did a little while ago!!?!

    Thursday, June 7, 2012 6:45 PM
  • No I don't think so without an extension - my extension does have a method LDShapes.SetImage(buttonPowerBall,tag01) that can do this.

    The download for this extension can be found here, just hit the download icon to the right of the LitDev extension.

    • Marked as answer by Namyegob Thursday, June 7, 2012 7:46 PM
    Thursday, June 7, 2012 6:52 PM
    Moderator
  • thank you so much, my friend! it works very well!! this whole thing is an excersize in graphics, i.e. drawing images and or text here & there. i'm still not certain if a button control is my solution or just using GraphicsWindow.MouseX & Y properties to perform the task i want, but thank you so much for the extension!!  i KNOW ima have fun with it later when i get more knowledge of programming under my belt.  i haven't done any of THAT since Qbasic 4.5!!?!  lol

    Well, I feel a whole heck of a lot more like I do now than I did a little while ago!!?!

    Thursday, June 7, 2012 7:45 PM