|
we need to check both conditions (e.Row.Rowstate & DataControlRowSatate)>0
now it will work fine
www.codepal.co.nr
Regards
Bino
http://www.codepal.co.nr
|
|
|
|
|
Hi All,
I am facing problem with the text box whose scrollbars property is enabled to "both".
The Problem is when i retrieve data from a file and show its content in the textbox above specified, I allow the user to type and I have written a small module which when user types "enter" key the format(that is number of tabs or spaces) present in the previous line will be applied to the new line created.
To say it in simple words it is little like the c# programming environment regarding the paragraph indentations it provides to us when we type enter key.
Since I wanted to add text in the textbox in any place where user wish, i am retrieving the text and doing my operations and i put the updated one back to the textbox.
In the above case when data is too large so the scrollbar is active,since i am adding the text in the textbox, the scrollbar is showing the first position though the cursor is blinking in the nextpage.
when I attempt to write it scrollbar moves and it is showing the place where cursor is moving,the moment i type enter it is doing the same i told above. so it is giving a flickering effect. It is annoying a lot.
I had used richtextbox and all those suspendlayout and resumelayout.
Here is my code
\\ code
richTextBox1.SuspendLayout();
\\ gets the current position
iPosition = richTextBox1.SelectionStart;
\\ finds the format of the previous line and stores that in formatpattern string
FormatPattern = FindFormatPattern(richTextBox1.Text, iPosition - 2);
\\ here am adding it in the textbox
richTextBox1.Text = richTextBox1.Text.Insert(iPosition,FormatPattern);
\\ setting the current position
richTextBox1.Select(iPosition + FormatPattern.Length, 0);
richTextBox1.ResumeLayout(true);
\\ code ends
Thanks In Advance
kandy
kandy
|
|
|
|
|
Hello Friends,
there is an mdi child form(say form1) and a non-mdi form( say form2). in form1,a label and a button exists. on button click event i opened form2. in form2 there is a button. on button click event of form2 i want to change the label.text value
of form1. how will i do it. if anyone have solution, please reply me.
i solved this problem when both form are simple form on form1_activated event using some condition.
Thanks,
Mukesh
|
|
|
|
|
This[^] article is a good place to start.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello Mr. O'Hanlon
Thanks for reply.but,that is not the answer of my question.
my question is ---- there is an mdi parent form(say form1) and an mdi child form(say form2) and a non-mdi form(say form3).on form1 a button control(say 'show form2')and on form2, a label control and a button control(say 'show form3') and on form3, a button control(say 'reflect changes the label value of form2') exist.
when application executes.form1 is loaded. when click on button(say 'show form2'),its mdi child (form2) shows and when click on button of form2, a non-mdi form(form3 - called simple form) show. now i want to change the label control'value of form2 on form3'button click event.
i solved this type of problem on form1_activated event using some condition,if both form (form2 and form3) are non mdi form.
on form2 initialize the variable---> public static string active="1";
form2_activated event
----------------------
if(active!="1")
{
label1.text="ramu";
active="1";
}
form3_button_click event
-------------------------
form2.active="2";
this.close();
but this concept does not affect the form2's label control,when form2 is mdi child form.
so, pls reply. i am waiting for your answer.
Thanks,
mukesh
|
|
|
|
|
Hai Everybody,
I am having a list view, in that i have assigned a context menu strip and it has to be displayed only when the items are clicked.
If I am clicking on the columns also it is displaying the same menu.
How to protect this?
Then I want to display another menu when the columns are clicked.
Can any one tell me suggestion to resolve this?
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi all, I am having problems adding controls to invisible panels. Making the long story short, if the panel has its property Visible set to false when I add the controls, they inherit that value. The problem is that when I set the panel to visible, those children are not shown and their property is still set to false.
Is this the correct behaviour, or am I doing something wrong? I will provide more details if needed.
Thank you,
Alessandro
|
|
|
|
|
cignox1 wrote: I will provide more details if needed
yes
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
|
|
|
|
|
Well, which kind of informations dou you need?
Something more:
I have a usercontrol that contains two panels. One of them is a tablelayoutpanel that contains dozens othe customcontrols. If I add these controls to the usercontrol when this is invisible, then they are also invisible. My problem is that when I put the usercontrol back to visible again, the two panels are displayed, but those controls are not. The only way I've found to make them visible is with the usercontrol visible, wich is not always desiderable in our project (it sould switch from visible to invisible on demand, without affecting the creation of the contained items).
I hope that this makes my problem easier to solve.
Thank you
|
|
|
|
|
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
|
|
|
|