|
Hi,
AFAIK Controls added to a Container don't inherit its Visible state, but the invisible
Container just does not invoke their Paint handlers.
If your UserControl behaves differently, then something in its code must do that;
Controls added to it should not copy its Visible property. I would call it a bug in the
UserControl, so that is where it must be fixed.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello,
When you change the control to visible, maybe also get it to repaint itself.
control1.Visible = true;
control1.Invalidate();
Probably you've already tried that. Oh well, just a thought.
BDF
|
|
|
|
|
Thank you, but I've already tried that. My problem is that when I add the controls to my panel when this is not visible, all the controls (wich are complex and thus formed by many controls) are created with Visible = false. This prevents them to be shown when I put the parent panel to visible.
|
|
|
|
|
cignox1 wrote: created with Visible = false
Aha! That's interesting. Not what I (nor Luc) would have expected. Since you are a few time zone ahead of me, you may have tried this already, too, but here goes.
My assumptions:
System.Windows.Forms.Panel tablelayoutpanel;
Your custom controls derive from System.Windows.Forms.UserControl
Either you or the designer do something like
tablelayoutpanel.Controls.Add(this.customControl2);
You could iterate the custom controls making them visible:
tablelayoutpanel.Visible = true;
foreach (Control c in tablelayoutpanel.Controls)
{
c.Visible = true;
}
BDF
|
|
|
|
|
Hi
I have 3 columns in my table. They are Yes\No filelds. If the row is Yes i want to take the header name of the column.in the below example if morning is yes i want to take Morning in datagrid
eg: if
Morning Evening Afternoon
Yes No YES
Yes Yes No
No Yes Yes
in the above example in first row Morning and Afternoon is True.
I want to retieve this to a Datagrid column Named Session.. i want to retrieve the above data to Session column
. in the case of first row i want to show like this in datagrid column
Session
Morning, Evening
Please help me to write Query and code
|
|
|
|
|
You might want to rephrase what you are trying to accomplish.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hy
I have a RichTextBox and I typing words separated with SPACE. I want to set different color for each word typed. Can anybody tell me how can I do that or give me an short example.
Thanks
|
|
|
|
|
Hai mihk, I'm working on similar application also.
In my opinion, you can do that on 2 ways.
1. scan through the first char loop until end, when you find "SPACE" / "32" in ASCII, you just put a little code of RTF Formatting. well, let's just say like this.
<br />
StringResult = "";<br />
StringResult = {\rtf\ansi {\colortbl; \red0\green0\blue255;\red255\green0\blue0;}; <br />
bool toggle = false;<br />
for(int i=0; i < YourString.GetLength(0); i++)<br />
{<br />
if(toggle)<br />
{<br />
StringResult = StringResult + @"\cf1";<br />
}<br />
else<br />
StringResult = StringResult + @"\cf2";<br />
<br />
StringResult = StringResult + YourString[i];<br />
<br />
if(YourString[i] == (char)32)<br />
{<br />
if(toggle) toggle = false;<br />
else toggle = true;<br />
}<br />
}<br />
you may search more about RTF formatting on microsoft web site.
2. you can just use the method RTB.Selection to change the font, forecolor, backcolor, etc. find more info about this on MSDN help.
CMIIW
|
|
|
|
|
I want to know how Yahoo messenger photo sharing works. Is it using byte streaming by using a web service? I want to develop that kind of application using C# or C++. So please help me to find some articles or sample source codes.
Regards,
Lilupa Karunarathne.
|
|
|
|
|
Hi All,
I have a MFC ActiveX control which has a method which returns a variant which
contains a safe array of double values .
void Calculate(double value,VARIANT *Result);
"Result" variable is of "Out" type.
When i'm trying to access this function from C# i'm by passing variable of type "Object" i'm getting RunTime Exception as follows
"An unhandled exception of ype 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))"
Please Anyone help me to solve this problem
I can access this from VB 6 without any issues.
Thanks in Advance
|
|
|
|
|
Hi
Can you supply the IDL of the Interface that contain the method you are trying to invoke ???
|
|
|
|
|
Hi nissims
Thanks for your reply,
Below is the IDL for my MFC ActiveX Control
library MyActiveXLib
{
importlib(STDOLE_TLB);
// Primary dispatch interface for CMyActiveXCtrl
[ uuid(9117C567-1EAD-48B3-BA9E-C4D44852D181),
helpstring("Dispatch interface for MyActiveX Control")]
dispinterface _DMyActiveX
{
properties:
methods:
[id(1), helpstring("method AddDataPoint")] void AddDataPoint(LONG lngIdx, DOUBLE dblXVal, DOUBLE dblYVal);
[id(2), helpstring("method AddDataPoints")] void AddDataPoints( LONG lngNoOfPoints, VARIANT varXVals, VARIANT varYVals);
[id(3), helpstring("method GetData")] LONG Calculate( DOUBLE dblXVal, VARIANT* varResult);
};
// Event dispatch interface for CMyActiveXCtrl
[ uuid(07A82910-34BC-43C2-ADAE-A462286D4E10),
helpstring("Event interface for MyActiveX Control") ]
dispinterface _DMyActiveXEvents
{
properties:
// Event interface has no properties
methods:
};
// Class information for CMyActiveXCtrl
[ uuid(E98E4ED3-C038-4705-8EAB-43AD8A1B75AB),
helpstring("MyActiveX Control"), control ]
coclass MyActiveX
{
[default] dispinterface _DMyActiveX;
[default, source] dispinterface _DMyActiveXEvents;
};
};
"varResult" variable of "Calculate" method will return the SafeArray of Double values.
Please suggest me the solution to solve this problem
Thanks again
|
|
|
|
|
Hi
Sorry about the delay, i just saw your answer now.
Are you passing an object argument that encapsulate a double array ???
For example:
object result = new double[10];
|
|
|
|
|
|
i want add reports to my project, my project contain 3 layers (1- presentation layer 2-Business Logic layer 3-Data Access layer )
|
|
|
|
|
Hi to all,
I want to check the specified file exist in the specified directory or not....
how can i do this?
Pravin
|
|
|
|
|
create the instance of FileInfo class
//FileInfo f;
initialze that in the following manner
//f = new FileInfo("something.txt");///mention the complete path
and then use this property to know whether this file exists or not
///if(f.Exists == false) /// means the file doesn't exist
ok
|
|
|
|
|
|
Hi
In order to check if a specific file exists
You can use the File.Exists static method , you can also use the
FileInfo.Exists property but for that you need to construct a FileInfo Object
|
|
|
|
|
Thanks Nissims,
i have used here object.FileExists(filespec) method.
Pravin
|
|
|
|
|
You can directly check the path using
if(System.IO.File.Exists(Path))
Regards
DilipRam
|
|
|
|
|
Hi Everybody,
We have a problem in displaying the data combining two tables....
we have table1 where a primary key is set to field1 and another table table2 where a foreign key is set to field1 with the same name as it is in the table1.
we gave the query to the data adapter as
" SELECT field1,field2,field3 FROM table2,table1 WHERE table1.field1=table2.field1";
But all the table2 rows are displayed without satisfying the condition we gave in the sql query.
Please help us at the earliest.
Thanks and Regards,
Priya
|
|
|
|
|
SELECT table1.field1,table1.field2,table1.field3
FROM table1 inner join table2 on table1.field1=table2.field1
Rami Abdalhalim
|
|
|
|
|
Thanks ..... It Worked....
But the filtered row is repeatedly getting displayed in the output table.....
We want the row to be displayed only once....
Please suggest..
Priya
|
|
|
|
|
Hello Everyone,
Can anybody let me know "Wht's the benefits of the Virutal function in C#"
|
|
|
|