473,883 Members | 3,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Tex tboxVisible = True or UserControl.Com boboxVisible = 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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("x", "a")
--
Marc R.
E-mail
Dim strAddr As String =Convert.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("x", "a")
Nov 21 '05 #1
6 9219
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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("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(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) 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.EventArg s)
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******** ******@TK2MSFTN GP09.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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("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******** ******@TK2MSFTN GP10.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.Tex tboxVisible = True or UserControl.Com boboxVisible = 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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("x", "a")
--
Marc R.
E-mail
Dim strAddr As String =Convert.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("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 mblnVisibleComb o As Boolean

Set(ByVal Value As Boolean)
mblnVisibleComb o = Value

Combobox.Visibl e = mblnVisibleComb o

End Set

instead of

Set(ByVal Value As Boolean)

Combobox.Visibl e = 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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("x", "a")

"Cor Ligthert [MVP]" <no************ @planet.nl> a écrit dans le message de
news: %2************* ***@TK2MSFTNGP1 4.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(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) 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.EventArg s)
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******** ******@TK2MSFTN GP09.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.ToStri ng(String.Forma t("{0}.{2}@{3}. {1}",
"mxrc", "cx", "robitxille ", "xrs-solutions")).Re place("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
8112
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 Runat="server" Text="Back"
4
2614
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 ("imgSession"), so the resulting control ID name will be imgSessionX. Where X could be a number corresponding to the ID of the image. I need help with the logic. Dim row As DataRow Dim myImage As Image
1
2419
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 sets the visible property. When the visible property is set.. 'Petition Type lblPetitionType.Visible = False
5
1662
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; one label, two buttons. - if Label1.Visible is set to True in the form designer, everything works as expected. Button1 toggles the label visibility, and Button2
2
18896
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, Keith
0
2445
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 a data view (which in turn is loaded from a manually setup DataTable for testing purposes). One of the columns in the grid is a checkbox that's tied to an event handler that'll change the .Visible property of a column with a text box. That text...
5
16316
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" runat="server" Text="Accept Trips" Visible="False"> Here's my test method: function test(checkbox)
8
4025
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 another location, or it will be maximized. Why does the child Form change its location when the Visible propery is set true (after being set to False)? Why doesn't it stay with the same Size and the same Location? Thanks.
5
3954
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' together with a search form, and the user can go back and forth. When the user hits ok, the form is hidden and the search form is shown and visa-versa. The problem is that when the form is hidden when the labels visible property is False, and then...
0
9944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9797
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7977
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4622
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.