Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Textless Button


  • Please log in to reply
6 replies to this topic
Ian
  • Guests
  • Last active:
  • Joined: --
Is it possible to create a button (or a number of a buttons) without any visible text on them?

Jensen's Button
  • Guests
  • Last active:
  • Joined: --
Yes.

Ian
  • Guests
  • Last active:
  • Joined: --
Anyone?

Superfraggle
  • Members
  • 1019 posts
  • Last active: Sep 25 2011 01:06 AM
  • Joined: 02 Nov 2004
Assuming you know how to create a button. Just create one without text.....

Have you even tried.

Failing a decent reply here, open the help file, type in button. This tells you how to make a button with text. Just omit the text.....

If you have tried this and have come accross an issue whilt doing this. Why don't you post the issue you are having and maybe some code to show you have tried. People will be more willing to help then.

DataLife
  • Members
  • 989 posts
  • Last active: Yesterday, 12:31 PM
  • Joined: 27 Apr 2008
Here is some code to get you started.
gui, add, button, w100 gFirstButton,
gui, add, button, w100 gSecondButton,
gui, show, Autosize, Example Title
return

FirstButton:
 {
  MsgBox First Button was pressed.
  Return
 }

SecondButton:
 {
  MsgBox Second Button was pressed.
  Return
 }

DataLife

DataLife
  • Members
  • 989 posts
  • Last active: Yesterday, 12:31 PM
  • Joined: 27 Apr 2008
Here is another example of how to use blank buttons. You can use guicontrol to change the button label.
Gui 1: add, text, ,Press the top left button.`nThe button below the top left button demostrates changing the button name.
xpos = 17
ypos = 37
wpos = 70
hpos = 20
buttonVar = 1 
Loop 75
 { 
  thisButton := Button%buttonVar% 
  Gui 1: Add, Button, x%xpos% y%ypos% w%wpos% h%hpos% gLabelToGotoWhenAnyButtonIsPressed,
  
  
  buttonVar++
  ypos := ypos+25
  
   if buttonVar = 16
   {
    xpos := xpos+76
    ypos := 37
   }
   if buttonVar = 31
   {
    xpos := xpos+76
    ypos := 37
   }
  if buttonVar = 46
   {
    xpos := xpos+76
    ypos := 37
   }

  if buttonVar = 61
   {
    xpos := xpos+76
    ypos := 37
   }
 } 

 Gui 1: show, autosize,Example Title
 Return
 
 LabelToGotoWhenAnyButtonIsPressed:
 MouseGetPos, , , , control  ; get control button number
 if control = button1
  {
   MsgBox Button 1 Pressed
   Return
 }

 if control = button2
  {
   MsgBox Button 2 Pressed. Click ok to see the button name added.
   guicontrol, 1: ,%control%, Button 2
   Return
  }

MsgBox Need to configure more buttons!`n`nPress the top left button or the button below the top left button.
Return
DataLife

Ian
  • Guests
  • Last active:
  • Joined: --
Thanks Datalife - brilliant! I appreciate your help.