473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Visible property does not change


Hello,

Hello,

I developed a UserControl. It has funny behavior. It is composed of three
controls. A texbox, a combobox and a button. There are three properties to
indicate the visibility of the three controls. The only property which
functions well is the one for the button. The two others, even if I do:
UserControl.TextboxVisible = True or UserControl.ComboboxVisible = True, the
textbox or the combobox remain invisible. I placed a BreakPoint on the Set
of the TextboxVisible property. The code look like that: TexBox.Visible =
Value. Even if Value is set to True the Visible property of the Textbox does
not change as if it were in readonly. Did somebody already had this problem?
It is not the first usercontrol that I make but it is the first time that I
have this kind of problem.

Any solution ?
Thanks

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")
--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")
Nov 21 '05 #1
6 9069
Marc,

Why don't you just test with visible = false instead of visible = value

At least does it give us more information that the value is not wrong.

Just my thought,

Cor
Nov 21 '05 #2
I tried this
Texbox.Visible = False
Texbox.Visible = True
that doesn't make any difference Visible property remain to false... I even
tried this

If Value Then
Texbox.Visible = True
Else
Texbox.Visible = False
End If

Same result

Any Idea?

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Cor Ligthert [MVP]" <no************@planet.nl> a écrit dans le message de
news: uD**************@TK2MSFTNGP09.phx.gbl...
Marc,

Why don't you just test with visible = false instead of visible = value

At least does it give us more information that the value is not wrong.

Just my thought,

Cor

Nov 21 '05 #3
I enven set a breakpoint in the Set of my Visible property and add a spy on
my textbox.visible property. In the spy window, we can change the values in
break mode. When I try to change the Visible property to True, it doesn't
change. False remain...

I am a little bit despaired :-(

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Marc Robitaille" <ma*************@ars-solutions.caa> a écrit dans le
message de news: eq**************@TK2MSFTNGP09.phx.gbl...
I tried this
Texbox.Visible = False
Texbox.Visible = True
that doesn't make any difference Visible property remain to false... I
even tried this

If Value Then
Texbox.Visible = True
Else
Texbox.Visible = False
End If

Same result

Any Idea?

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Cor Ligthert [MVP]" <no************@planet.nl> a écrit dans le message de
news: uD**************@TK2MSFTNGP09.phx.gbl...
Marc,

Why don't you just test with visible = false instead of visible = value

At least does it give us more information that the value is not wrong.

Just my thought,

Cor


Nov 21 '05 #4
Marc,

I have not any problem

\\\ You can just open a form and than past this in after the #region (be
aware of ' that last End Class what I have deleted for this purpose)
Private mc As New mycontrol
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.Controls.Add(mc)
AddHandler mc.but.Click, AddressOf btclick
End Sub
Private Sub btclick(ByVal sender As _
System.Object, ByVal e As System.EventArgs)
If mc.tb.Visible = True Then
mc.tb.Visible = False
Else
mc.tb.Visible = True
End If
End Sub
End Class
Public Class mycontrol
Inherits GroupBox
Public but As New Button
Public tb As New TextBox
Public Sub New()
Me.Height = 70
Me.Width = 130
tb.Text = "Hello World"
but.Location = New System.Drawing.Point(20, 10)
tb.Location = New System.Drawing.Point(10, 40)
Me.Controls.Add(but)
Me.Controls.Add(tb)
End Sub
///
I hope this helps,

Cor
"Marc Robitaille" <ma*************@ars-solutions.caa> schreef in bericht
news:eq**************@TK2MSFTNGP09.phx.gbl...
I tried this
Texbox.Visible = False
Texbox.Visible = True
that doesn't make any difference Visible property remain to false... I
even tried this

If Value Then
Texbox.Visible = True
Else
Texbox.Visible = False
End If

Same result

Any Idea?

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Cor Ligthert [MVP]" <no************@planet.nl> a écrit dans le message de
news: uD**************@TK2MSFTNGP09.phx.gbl...
Marc,

Why don't you just test with visible = false instead of visible = value

At least does it give us more information that the value is not wrong.

Just my thought,

Cor


Nov 21 '05 #5
Are these controls in a container control, such as a panel?

"Marc Robitaille" <ma*************@ars-solutions.caa> wrote in message
news:uJ**************@TK2MSFTNGP10.phx.gbl...

Hello,

Hello,

I developed a UserControl. It has funny behavior. It is composed of three
controls. A texbox, a combobox and a button. There are three properties to
indicate the visibility of the three controls. The only property which
functions well is the one for the button. The two others, even if I do:
UserControl.TextboxVisible = True or UserControl.ComboboxVisible = True,
the
textbox or the combobox remain invisible. I placed a BreakPoint on the Set
of the TextboxVisible property. The code look like that: TexBox.Visible =
Value. Even if Value is set to True the Visible property of the Textbox
does
not change as if it were in readonly. Did somebody already had this
problem?
It is not the first usercontrol that I make but it is the first time that
I
have this kind of problem.

Any solution ?
Thanks

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")
--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

Nov 21 '05 #6
Thank you. I tested your code in a new form and it works perfectly. But,
that did not solved my problem. I have circumvent the problem in this way.

Private mblnVisibleCombo As Boolean

Set(ByVal Value As Boolean)
mblnVisibleCombo = Value

Combobox.Visible = mblnVisibleCombo

End Set

instead of

Set(ByVal Value As Boolean)

Combobox.Visible = Value

End Set

Has you can see, it is very strange but it works now!!!!

Thank you

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Cor Ligthert [MVP]" <no************@planet.nl> a écrit dans le message de
news: %2****************@TK2MSFTNGP14.phx.gbl...
Marc,

I have not any problem

\\\ You can just open a form and than past this in after the #region (be
aware of ' that last End Class what I have deleted for this purpose)
Private mc As New mycontrol
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.Controls.Add(mc)
AddHandler mc.but.Click, AddressOf btclick
End Sub
Private Sub btclick(ByVal sender As _
System.Object, ByVal e As System.EventArgs)
If mc.tb.Visible = True Then
mc.tb.Visible = False
Else
mc.tb.Visible = True
End If
End Sub
End Class
Public Class mycontrol
Inherits GroupBox
Public but As New Button
Public tb As New TextBox
Public Sub New()
Me.Height = 70
Me.Width = 130
tb.Text = "Hello World"
but.Location = New System.Drawing.Point(20, 10)
tb.Location = New System.Drawing.Point(10, 40)
Me.Controls.Add(but)
Me.Controls.Add(tb)
End Sub
///
I hope this helps,

Cor
"Marc Robitaille" <ma*************@ars-solutions.caa> schreef in bericht
news:eq**************@TK2MSFTNGP09.phx.gbl...
I tried this
Texbox.Visible = False
Texbox.Visible = True
that doesn't make any difference Visible property remain to false... I
even tried this

If Value Then
Texbox.Visible = True
Else
Texbox.Visible = False
End If

Same result

Any Idea?

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Cor Ligthert [MVP]" <no************@planet.nl> a écrit dans le message
de news: uD**************@TK2MSFTNGP09.phx.gbl...
Marc,

Why don't you just test with visible = false instead of visible = value

At least does it give us more information that the value is not wrong.

Just my thought,

Cor



Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John South | last post by:
Hi I'm new to asp.net and c# and I've got stuck on an apparently simple problem: I'm trying to make a HyperLink dynamically visible/invisible. This is the HTML: <asp:HyperLink...
4
by: Andy G | last post by:
I am tring to loop through a dataset to find records that exist. If the record exists then make the corresponding image visible. So I try to take the row value and concatenate it onto a string...
1
by: mike | last post by:
Hi, I'd like advice from a .NETer. I have a loadcombo routine which sets the selectedindex to -1 if it's an "add record", but then it goes to a security routine which, based on permissions...
5
by: Lucvdv | last post by:
Can anyone explain why this happens with the code at the bottom? It looked like a thread safety issue, but changing the declaration of Label1 to Shared doesn't help. Standard windows form;...
2
by: Keithb | last post by:
I need to hide a GridView's "edit" column if the user's role does not support editing. However, the column's Visible property does not support databinding. Is there a workaround? Thanks, ...
0
by: landesjoe | last post by:
Hi, here's my problem in short: Text boxes in gridview don't seem to hold their value if the column's .Visible property is changed back and forth. I've got a form with a gridview populated from...
5
by: Doogie | last post by:
Hi, I am trying to access the visible property of an ASP button inside javascript to no avail. Here's what my button control looks like: <asp:Button id="btnAcceptTrips" name="btnAcceptTrips"...
8
by: Doc John | last post by:
I have an MDI container with a child Form which will be visible according to certain events. The problem is that when I set the property Visible to False and then back to True, the Form will be in...
5
by: =?Utf-8?B?VGVycnk=?= | last post by:
Hi, I have a couple of labels on a form and their visible property is bound to boolean properties on a custom object. When I first load the form, all works as it should. This form is 'tied'...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.