Click here to Skip to main content
15,922,015 members
Home / Discussions / C#
   

C#

 
GeneralFormating doubles Pin
Flack17-Jan-05 11:43
Flack17-Jan-05 11:43 
GeneralRe: Formating doubles Pin
Christian Graus17-Jan-05 12:25
protectorChristian Graus17-Jan-05 12:25 
GeneralRe: Formating doubles Pin
Stefan Troschuetz17-Jan-05 21:13
Stefan Troschuetz17-Jan-05 21:13 
GeneralWindows Installer questions... Pin
new_phoenix17-Jan-05 11:24
new_phoenix17-Jan-05 11:24 
GeneralRe: Windows Installer questions... Pin
Heath Stewart18-Jan-05 10:16
protectorHeath Stewart18-Jan-05 10:16 
GeneralAppending DataTable Pin
myNameIsRon17-Jan-05 11:10
myNameIsRon17-Jan-05 11:10 
GeneralRe: Appending DataTable Pin
Heath Stewart18-Jan-05 10:18
protectorHeath Stewart18-Jan-05 10:18 
Generalpropertygrid with browsable Pin
GoodQuestion17-Jan-05 11:04
GoodQuestion17-Jan-05 11:04 
I have question about browsable in propertygrid. I am trying to change browsable 's bool value bec sometimes it dont need to show all properties. Like sometimes First dont need to be browsable. I am well-aware that I cant change the browsable's value bec it need to be constant variable while it is run-time. what is your suggestions tht I can change browsable 's bool value while it is run-time?

For example:
for()
{
[Browsable(???)] or [SwitchBrowsable(type,propertyName,bool)]//////can be true or false
public string First
{
get { return m_strFirst; }
set { m_strFirst = value; }
}
[Browsable(???)] or [SwitchBrowsable(type,propertyName,bool)]///can be true or false
public string Second
{
get { return m_strSecond; }
set { m_strSecond = value; }
}
[Browsable(????)] or [SwitchBrowsable(type,propertyName,bool)]//////can be true or false
public string Third
{
get { return m_strThird; }
set { m_strThird = value; }
}
}

I made this function to change true to false from browable but it wont let
me to change bec it is readonly so it wont work or I may overlooking something.
public static void SwitchBrowsable(Type type, string propertyName)
{
try
{
object[] o = type.GetProperty(propertyName).GetCustomAttributes(typeof(BrowsableAttribute), true);
if (o != null && o.Length > 0)
{
BrowsableAttribute ba = o[0] as BrowsableAttribute;
bool test = ba.Browsable;
//ba.Browsable = !ba.Browsable;
test = false;
//ba.Browsable = false;
//ba.Browsable = !ba.Browsable;
}
}
catch(Exception error)
{
Debug.Assert(false);
//CExceptionLib.DisplayErrorMessage(error);
}

}
GeneralRe: propertygrid with browsable Pin
Heath Stewart18-Jan-05 10:27
protectorHeath Stewart18-Jan-05 10:27 
GeneralDateTime Save null Pin
webhay17-Jan-05 9:24
webhay17-Jan-05 9:24 
GeneralRe: DateTime Save null Pin
Christian Graus17-Jan-05 9:58
protectorChristian Graus17-Jan-05 9:58 
GeneralRe: DateTime Save null Pin
Heath Stewart17-Jan-05 10:58
protectorHeath Stewart17-Jan-05 10:58 
GeneralRe: DateTime Save null Pin
webhay17-Jan-05 11:46
webhay17-Jan-05 11:46 
GeneralRe: DateTime Save null Pin
Christian Graus17-Jan-05 12:29
protectorChristian Graus17-Jan-05 12:29 
Generalgdi line cursor Pin
bwagz17-Jan-05 9:14
bwagz17-Jan-05 9:14 
GeneralRe: gdi line cursor Pin
Heath Stewart17-Jan-05 11:04
protectorHeath Stewart17-Jan-05 11:04 
GeneralSerial Port (RS-232) Programming Pin
mci8407817-Jan-05 8:52
mci8407817-Jan-05 8:52 
GeneralRe: Serial Port (RS-232) Programming Pin
Jeff Bramwell17-Jan-05 10:20
Jeff Bramwell17-Jan-05 10:20 
GeneralControls Questions on winform. Pin
stan2817-Jan-05 8:17
stan2817-Jan-05 8:17 
GeneralRe: Controls Questions on winform. Pin
Anonymous17-Jan-05 9:38
Anonymous17-Jan-05 9:38 
GeneralRe: Controls Questions on winform. Pin
Dennis C. Dietrich17-Jan-05 10:31
Dennis C. Dietrich17-Jan-05 10:31 
GeneralRe: Controls Questions on winform. Pin
stan2818-Jan-05 5:03
stan2818-Jan-05 5:03 
Generalactive directory Pin
sujithapril17-Jan-05 7:21
sujithapril17-Jan-05 7:21 
GeneralC# app using Crystal Reports Pin
braber17-Jan-05 6:19
braber17-Jan-05 6:19 
GeneralXML-Updating of record Pin
Adnan Siddiqi17-Jan-05 6:14
Adnan Siddiqi17-Jan-05 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.