Hi,
Could someone tell me how to make a button that isn't seen to the user, but still can be pressed If i use button1.visible = false then you can't press it.
Thanks in advance,
Josh
Hi,
Could someone tell me how to make a button that isn't seen to the user, but still can be pressed If i use button1.visible = false then you can't press it.
Thanks in advance,
Josh
Inivsible Button
svenderuyter
Set its FlatAppearance.Border to 0 and the BackGround to Transparent, FlatStyle = Flat and no text. So it should be transparent but clickable.
--
SvenC
WaYdotNET
ehsan sadeghi
Also, I get this when i try to change flat aperance/button border to transparent in the properties:
ButtonBase controls do not support setting the BorderColor to Transparent.
sascue
I thought of that Idea too...But-I have am image in the backround.
I can post all my codes in a bit, but I g2g now...
c ya soon!
Uncle Ted
Make a label with blank text as shown below:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(0, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(52, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = " "
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class
Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
MsgBox("test")
End Sub
End Class
Leaf.
Heres my code:
Public
Class Form1
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.ClickPictureBox1.Visible =
TrueButton2.Visible =
TrueButton1.Visible =
TrueNewUser.Visible =
FalseButton3.Visible =
False
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickNewUser.Visible =
TrueButton3.Visible =
TruePictureBox1.Visible =
FalseButton2.Visible =
FalseButton1.Visible =
False End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickUC.Visible =
TrueButton4.Visible =
TrueButton5.Visible =
TruePictureBox2.Visible =
TrueButton1.Visible =
FalseButton2.Visible =
FalsePictureBox1.Visible =
Falseusername.Visible =
True End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.ClickPictureBox1.Visible =
TrueButton1.Visible =
TrueButton2.Visible =
TruePictureBox2.Visible =
FalseButton4.Visible =
FalseButton5.Visible =
Falseusername.Visible =
False
End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End SubEnd
ClassPK2000
Talldude, I found a way to do this that will fit my needs, but, now I have a new similar problem.
1. If i make a label with spaces it shows up as a grey rectangle
2. To fix the buttons I just took a screenshot, edited out the parts I didn't want in Paint, then used that as a button image.
3. Now I need a TextBox that you can type in, but transparent. I'll try the image editing thing, but I don't think it will work...
-Josh
Benj78
If your form had it's default settings, with
a background color of 'control' and no
background images or the like added, then
the label would have appeared as 'invisible.'
If you keep the default settings, and change the
textbox backcolor to 'control' and change it's
border style to 'none', it will also appear 'invisible.'
You though, probably want to take a different path.
So I may not have solutions.
If you need additional help, you may want to find the
Form1.Designer.vb (the InitializeComponent part)
and post it, as well as your form1.vb code for
others to see what you are up to.
Good luck!
robertje
Just add a label to form1 and make it's text
about 10 blanks. Then:
Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
MsgBox("test")
End Sub
End Class
AshishGupta
Mantorok
I am showing you the 'InitializeComponent' partial class first.
That part is normally created automatically as you add things
to your form.
The Form1 code (the code the programmer normally
types) is the last little part at the end.
barkingdog
Instead of using a button just use the underlying control, and when the user clicks check if it's in the wanted rectangle area.
if rectangle.contains(x,y) then
doStuff
end if
laboremus
lol
, I like your thinking, but too bad it doesn't work...(label thing)
Its the same problem with the button-IT STILL SHOWS UP
Please help...
Biju S Melayil
Tall dude, are you sure this is for VB express edition there are many errors...
Could someone please help me I still cant get this to work!!!!