|
I think I might of figured out how to pass the list to the child form. By Adding a Public List<string> in the child form. WOrking on testing that But now I have a somewhat new question....
How do I have the child form return the result of Dialogbox.ok?
I have set the child form's ok and cancel button's dialog property to the ok and cancel property. But I am unsure how to pass that to the parent form.
|
|
|
|
|
JollyMansArt wrote: allow the form to add/delete items from the list variable for the (to,cc,bc) email addresses. Then finally pass the new list objects ...
That is wrong, when you add/delete to a list (which is an object) it still is the same list (i.e. the same object, the difference is it may contain some other items).
For the rest, I'm not going to study all that, it is way too much code for anything you may want to do. And AFAIK some of it will not even compile.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
I figured out finally how to pass the array to the child and back...
Parrent Form:
using (frmpopupEmailRecipient popupVerifyEmailRecipients = new frmpopupEmailRecipient())
{
popupVerifyEmailRecipients.MyEmailTo = EmailTo;
popupVerifyEmailRecipients.MyEmailCC = EmailCC;
if (popupVerifyEmailRecipients.Show() == DialogResult.OK)
{
}
EmailTo = popupVerifyEmailRecipients.MyEmailTo;
EmailCC = popupVerifyEmailRecipients.MyEmailCC;
}
Child Form:
public partial class frmpopupEmailRecipient : Form
{
public List<String> MyEmailTo;
public List<String> MyEmailCC
}
Now optionally I would like for learning instead of just closing the frm... How do I modify the child form to return a dialogresult.ok value?
|
|
|
|
|
A Control (a Form IS a Control) offers the following methods amongst others:
public void Show()
public DialogResult ShowDialog()
and the MSDN page on ShowDialog clearly explains how the return value is determined.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
hi
how to make line after 2 rows in crystal report ?
ex:
aaaaaa
bbbbbb
------------------------------------
cccccc
ddddddd
------------------------------------
(working in C#)
thank's in advance
|
|
|
|
|
You create a formula field with below code and drag drop that field into ur crystal report detail section below ur data field, I hadnt checked may be it will work..<br />
<br />
<br />
Global booleanVar flag:=true;<br />
Local stringVar print ;<br />
if flag then print :="__________________________________";<br />
flag=false;<br />
if flag=false then<br />
flag:=true;<br />
print :=""
modified on Thursday, October 22, 2009 2:27 AM
|
|
|
|
|
You create a formula field with below code and drag drop that field into ur crystal report detail section below ur data field, I hadnt checked may be it will work..
shared booleanVar flag;
if flag then
(
flag:=false;
"";
)
else
(
flag:=true;
"__________________________________" ;
);
It will work !!!!!!!!!!!!!!!!!!
|
|
|
|
|
I need to get informed about every incoming network connection in C#.
All examples I found on the web were client/server stuff.
But I don't have any clients.
I want to get notified about all incoming connections at all ports.
How does it work? Which class can I use? Are there any events?
Thanks in advance for any hints and help.
Max
|
|
|
|
|
Wild Max wrote: Which class can I use? Are there any events?
.NET doesn't have an event that handles all incoming connections. Some connections are even made without the Frameworks' knowledge!
You could dive into the Firewall API, I believe that all connections pass through there.
I are Troll
|
|
|
|
|
string message = Timetable(doc);
public string Timetable(XmlDocument xmldocument)
{
string timetableResult = "";
if (xmldocument != null)
{
Output("Processing...");
using (StreamReader sw = new StreamReader(new FileStream("out1.xml", FileMode.Open)))
{
string str = sw.ReadToEnd();
//extraction and suppose there's a string here which I want to return
}
}
}
I can't seem to return a string, the error says :Could not load file or assembly 'RS232, Version=1.24.0.0, Culture=neutral, PublicKeyToken=515d87df384dcc81' or one of its dependencies. The system cannot find the file specified.
Please help.
|
|
|
|
|
Apparently, something in the code you are not showing is depending on a class in the RS232 library and that library cannot be found.
P.S. If the component from that library is a serial port and you are on .NET 2+, you could consider switching to the built in System.IO.Ports.SerialPort class.
|
|
|
|
|
Hi
i have a simple unBound field in my report designer named 'UnboundString1'.
i want to pass value to this field froom code, but i don't know how to do that. i also create a parameterField and use this code to pass value but nothing happened :
this.customersTableAdapter.Fill(this.northwindDataSet.Customers);
ParameterField myParam = new ParameterField();
myParam.ParameterFieldName = "UnboundString1";
ParameterDiscreteValue myDiscreteValue = new ParameterDiscreteValue();
myDiscreteValue.Value = "USA";
myParam.CurrentValues.Add(myDiscreteValue);
this.crystalReportViewer1.ParameterFieldInfo.Add(myParam);
this.CustomersReport1.SetDataSource((DataTable)this.northwindDataSet.Customers);
this.CustomersReport1.Refresh();
this.crystalReportViewer1.RefreshReport();
how to workaround this problem ?
|
|
|
|
|
Hi
i have a datagridview in a form that have a ComboBox column.
i want to send a value from an other form to datagridview combo box column.
i connected the combo box column to a table that show a member in Display Member
and return the Value Member but i dont know how to get the value in value member.
actually i lookin for something like SelectedValue in ComboBox Class.
how can i it?
thanks
|
|
|
|
|
The following code will get the value. You can ignore the fact that it is a DataGridViewComboBoxColumn for your purpose.
DataGridViewRow currRow = this.dataGridView1.CurrentRow;
this.txtValue.Text = currRow.Cells["CBColumn"].Value.ToString();
DataGridViewRow anyRow = this.dataGridView1.Rows[2];
this.txtValue.Text = anyRow.Cells["CBColumn"].Value.ToString();
DataGridViewCell currCell = this.dataGridView1.CurrentCell;
this.txtValue.Text = currCell.Value.ToString();
I have split the processing into two lines, and I would probably do this anyway because it is easier to understand. However, you could do it in one line, like this: (I have only shown the first one although you could do the same for all three)
this.txtValue.Text = this.dataGridView1.CurrentRow.Cells["CBColumn"].Value.ToString();
**NOTE**
'CBColumn' is the Name I have given to my DataGridViewComboBoxColumn , the Name property, not the HeaderText
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi group,
I'm converting a large old C++ program to C#. It has lots and lots and lots of istream/ostream io. Is there an equivalent io capability in C#? Any suggestions on the most efficient way to do this.
Thanks /Mike
|
|
|
|
|
The demo edition of our 'C++ to C# Converter' will allow conversion of some of the C++ IO methods/operators. Console.Write and Console.Read are used in addition to some helper methods for conversion of 'cin'.
David Anton
http://www.tangiblesoftwaresolutions.com
Convert VB to C#, C++, or Java
Convert C# to VB, C++, or Java
Convert C++ to C#, VB, or Java
Convert Java to C#, C++, or VB
|
|
|
|
|
There are tons of stream classes in C#. You should perhaps buy a C# reference.
If your C++ program includes extensions to iostreams, you're probably looking at a full rewrite of how you approach things.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for the answers. Here is a code fragment I found here <http: www.java2s.com="" tutorial="" cpp="" 0240__file-stream="" performbothinputandoutput.htm="">
Is there c# support for this type of stream io?
<br />
#include <iostream><br />
#include <strstream><br />
using namespace std;<br />
<br />
int main()<br />
{<br />
char iostr[80];<br />
<br />
strstream strio(iostr, sizeof(iostr), ios::in | ios::out);<br />
<br />
int a, b;<br />
char str[80];<br />
<br />
strio << "10 20 testing ";<br />
strio >> a >> b >> str;<br />
cout << a << " " << b << " " << str << endl;<br />
<br />
return 0;<br />
}<br />
|
|
|
|
|
In C# i placed an rdlc report viewer on a windows form now when i make an object of the form it wont call the report viewer. please help if any .
<pre>
RdlcReportViewer rv = new RdlcReportViewer();
rv.<u>reportViewer1</u>.LocalReport.EnableHyperlinks = true;
rv.<u>reportViewer1</u>.LocalReport.ReportEmbeddedResource= "test.RdlcRptPayments.rdlc";
</pre>
thankx.
|
|
|
|
|
Have you looked at this? msdn[^]
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
I have come across an interesting problem. If I have a DataSet which I've read from an XML file. Then I call WriteXML to my memory stream. If I try read it back into a dataset I get the following error "Root Element is missing"
here is some example code.
DataSet ds = new DataSet(); <br />
ds.ReadXmlSchema(@"C:\Foo\FooSchema.xsd");<br />
ds.ReadXML(@"C:\Foo\Foo.xml"); <br />
<br />
MemoryStream ms = new MemoryStream(); <br />
ds.WriteXml(ms); <br />
ds.ReadXml(ms);
Does anyone know why? or how I can use a DataSet to read directly from a MemoryStream?
modified on Tuesday, October 20, 2009 9:58 AM
|
|
|
|
|
The current position pointer of the memory stream is left at the end when you do the ds.WriteXml . You have to do something (apologies, no access to IDE right now) like ms.CurrentPosition = 0; before the the ReadXml to move it back to the start.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
In your example you try to read after the written data (MemoryStream position != 0).
You have to reset the read position of the memory stream.
MemoryStream ms = new MemoryStream();
ds.WriteXml(ms);
ms.Seek(0, SeekOrigin.Begin);
ds.ReadXml(ms);
|
|
|
|
|
Aah yes, silly me, I forgot about the pointer.
Thank you!
|
|
|
|
|
Keefb is coirrect, you have to rewind the stream, using:
if (ms.CanSeek)
{
ms.Seeek(0,SeekOrigin.Begin);
}
But be aware it may not work! You may well need ms.FlushFinalBlock() to ensure that last bit of data is written.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|