|
Have a look at SelectionColor of richtextbox
|
|
|
|
|
|
I am printing my Datatable to excel but I noticed when it reaches a certain number of rows it causes an exception.
Is there a limit to the number of DataTable rows that can be exported to a worksheet? If so, is there a way around this?
I am using Microsoft.Office.Interop.Excel.
Thanks in advance!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
There is no such limit i guess, even if exists it is close to 65k i guess!
What is your row count?
Gautham
|
|
|
|
|
Sometimes more than 100K rows. If there is such a limit, I'm thinking of breaking up the resultset (DataTable) in multiple worksheets.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
If that is acceptable by the end user then i would say it as a good solution
Gautham
|
|
|
|
|
How to check if the form is already open, so that it cannot be duplicatly openned
|
|
|
|
|
do it with the form load event that like this:
if (Process.GetProcessesByName(yourprocessname).Length >=1){
MessageBox.show("already opened!");
return;
}
|
|
|
|
|
I think he meant some form he has in his application, not the application itself
|
|
|
|
|
if that is like you said, that needs to use Mutex.
|
|
|
|
|
|
Thanks but my problem i want to close form1 before opening form2
|
|
|
|
|
Use singleton design pattern and it'll solve your problem
for example u want form1 to be checked if it's already opened
take a object of form1 with in your form1 class
make the constructor private of your form1 class
make a public static method
with in that method check if the object is null or not if null assign a new instance of your form1 and if not null then return the already initialized instance
|
|
|
|
|
Best way to solve this is to to make your class constructor private and put static method that returns reference to only instance of your class
Code example:
<br />
class Example<br />
{<br />
private static Example THIS = null;<br />
<br />
public static Example CREATE_FORM()<br />
{<br />
if (THIS == null)<br />
THIS = new Example();<br />
<br />
return THIS;<br />
}<br />
<br />
private Example()<br />
{<br />
}<br />
}<br />
|
|
|
|
|
if( myForm != null && !myForm.Disposing && myForm.IsHandleCreated)
return;
else
myForm.Show();
|
|
|
|
|
hi i am currently using c# visual studio 2005 window application
and i would like to make an event handler which would execute when a string variable data changes
i though it may be possible when i came accross form1.desinger.cs and saw the codes like:
private void InitializeComponent()<br />
{<br />
this.textBox1 = new System.Windows.Forms.TextBox();<br />
this.button1 = new System.Windows.Forms.Button();<br />
this.SuspendLayout();<br />
this.textBox1.Location = new System.Drawing.Point(89, 127);<br />
this.textBox1.Name = "textBox1";<br />
this.textBox1.Size = new System.Drawing.Size(100, 20);<br />
this.textBox1.TabIndex = 0;<br />
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);<br />
this.button1.Location = new System.Drawing.Point(203, 198);<br />
this.button1.Name = "button1";<br />
this.button1.Size = new System.Drawing.Size(75, 23);<br />
this.button1.TabIndex = 1;<br />
this.button1.Text = "button1";<br />
this.button1.UseVisualStyleBackColor = true;<br />
this.button1.Click += new System.EventHandler(this.button1_Click);<br />
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);<br />
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;<br />
this.ClientSize = new System.Drawing.Size(292, 266);<br />
this.Controls.Add(this.button1);<br />
this.Controls.Add(this.textBox1);<br />
this.Name = "Form1";<br />
this.Text = "auction";<br />
this.Load += new System.EventHandler(this.Form1_Load);<br />
this.ResumeLayout(false);<br />
this.PerformLayout();
|
|
|
|
|
One way to achieve what you are looking for would be to create a Property for the string variable and raise the event yourself in the setter..
|
|
|
|
|
how can i do that?
what are the steps involve?
|
|
|
|
|
you should be able to figure that out. but this should get you started (warning this is uncompiled, untested:
public delegate void MyStringChangedDelegate(string newVal);<br />
public event MyStringChangedDelegate MyStringChanged;<br />
<br />
<br />
string myString; <br />
public String MyString<br />
{<br />
get<br />
{<br />
return myString;<br />
}<br />
set<br />
{<br />
myString = value;<br />
if(MyStringChanged!=null)<br />
MyStringChanged(value);<br />
}<br />
}
|
|
|
|
|
hi everybody,
i m creating a browser in 2005 .net using c#.i came across the problem.i want to open a new form on closing event of old form. New form has field userid n password,only after verifying valid user both form should be closed.if user is not valid then old form should not be closed.
if any idea then send me some clue if possible please send me source code in c#.
|
|
|
|
|
Show the new form in the onclosing event of the first one. After validating it close the new form and the old form will be closed too. If you want to cancel closing of old form have a look at the second argument of the onclosing event
|
|
|
|
|
You want people to provide credentials in order to close your app ?
Yeah, handle the onclosing event and set the properties of the event args to cancel the close if you need to.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This is a question actually: if you want to connect more clients to a server using .NET remote, and you want them to interchange message using the server, how would u do that?
i already know how to send messages to the server using remote objects, but i don't know in what way will the server know from which client(ip address) it got the message, and how to send the message to a specific client...
that's what i mean by inter-client communication.
|
|
|
|
|
Hi all.
I have a windows service that inserts some messages in a database. Now, I need an interface so a user can see the process.
My first option was adding an interface to the service. Is that possible? I've been reading about that and is not very usual.
If not, the option would be creating another application that communicates with the service and shows the messages. In that case, how can I do that? Should I use Remoting? I'm not sure about how to get the messages from the service. My service is just a loop that listens to a socket and inserts the received messages in a database. If the service can have an interface, it would be as easy as showing a message in a control after each message processed.
Any ideas please?
Regards,
Diego F.
|
|
|
|
|
I'm sorry if this sounds stupid, but cant we filter datasets in a very simple and effective way??
Thanks a bunch guys.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|