|
This is easy. Create a method that checks if the form is visible or not.
(Hint: use the Visible property)
Kristian Sixhoej
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Check to see if the form is visible.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i want to know if is visible from another application not the same application
i hope that now that s is more clear
|
|
|
|
|
Morad SAJID wrote: i want to know if is visible from another application not the same application
i hope that now that s is more clear
How can I put this simply? If you want to know if application B is visible or not, then application A is going to have to query it and ask it if it is visible or not. Hence, application B will have to provide this information. That's what we've been telling you all along. There's no easy way for the first application to know this - it's the responsibility of the second app to tell it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
yes thank you
i have an idéa but i don't know if it will be works;
i ll change the process name of the application A, the application B will looking for the first name of application A , when it will not find it it will know that my application is hided,
but how to change the processname of my application;
thakks again
|
|
|
|
|
I would have the application that shows/hides create a named Mutex when it is visible. It can release the Mutex when it gets hidden.
The calling app can try and create the same named Mutex and if it fails, it knows the application is visible. If it succeeds, it releases the Mutex and knows that the application is hidden.
|
|
|
|
|
Hi Guys. I need a bit of help. I want to put a sql server connection together but don;t know how. I have only previously worked with .MDF files but now want to put a connection together to a SQL server. The details of the server is as such.
Server - JBSQL1\DEV1
DataBase - CSIS
How do I use this to create a sql server connection? Or do you guys know of any documentation that states clearly how to do this as I have looked, googled and nothing seems clear and straight forward.
Any help would be greatly appreciated.
|
|
|
|
|
Kwagga wrote: I want to put a sql server connection together but don;t know how.
Here[^]
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i got some error while connecting the server database(sqlserver in DATABASE sever) ....System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
when i put the code in server
but i can connect it in client side(using .net 2005 development platform)
i just use the code
SqlConnection con = new SqlConnection("Data Source=server ip;initial catalog=database name;uid=userid;pwd=password");
sqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from StLogin";
cmd.Connection = con;
SqlDataReader dr;
con.Open();
dr = cmd.ExecuteReader();
while (dr.Read() != false)
{
DropDownList1.Items.Add(dr[1].ToString());
}
|
|
|
|
|
I'm sick of answering this one for people. Here[^], help yourself.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
imatetvm wrote: Urjent
The subject should contain a useful description of the question.
However urgent you may feel that the question is, it's never urgent enough to mention in the subject, or you would not post the question in a forum instead of paying someone for support.
imatetvm wrote: i got some error while connecting the server database
Have you considered the possible explanation that was given to you in the error message already?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hello
within my application i have a richtextbox, when i trying to print someting it doesn't work.
Bullets are not shown on the printpreview hereby the code
// OnBeginPrint
private void OnBeginPrint(object sender,
System.Drawing.Printing.PrintEventArgs e)
{
char[] param = { '\n' };
if (printDialog1.PrinterSettings.PrintRange == PrintRange.Selection)
{
lines = richTextBox1.SelectedText.Split(param);
}
else
{
lines = richTextBox1.Text.Split(param);
}
int i = 0;
char[] trimParam = { '\r' };
foreach (string s in lines)
{
lines[i++] = s.TrimEnd(trimParam);
}
}
// OnPrintPage
private void OnPrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
int x = e.MarginBounds.Left;
int y = e.MarginBounds.Top;
Brush brush = new SolidBrush(richTextBox1.ForeColor);
while (linesPrinted < lines.Length)
{
e.Graphics.DrawString(lines[linesPrinted++],
richTextBox1.Font, brush, x, y);
y += 15;
if (y >= e.MarginBounds.Bottom)
{
e.HasMorePages = true;
return;
}
else
e.HasMorePages = false;
}
}
I hope someone canhelp me
thanks anyway
-- modified at 8:41 Thursday 8th November, 2007
Greetzzz
Rudy
|
|
|
|
|
Hi,
first of all I don't have any experience printing RTB content. But looking at your code
I can see you only take its (Selected)Text, i.e. the string representing its content,
ignoring all formatting (font selection, colors, bullets, ...). This does not look right.
May I suggest you search CP (or Google) for "RichTextBox print".
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I did not find any solution thats work properly
Greetzzz
Rudy
|
|
|
|
|
That is not very informative, you don't tell us what you did and tried, and what parts
did or did not work.
Did you search CodeProject articles? Here is one for starters[^].
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Ok problem solved, i fond the code on msdn
Thanks anayway
Greetzzz
Rudy
|
|
|
|
|
If we get a resultset from a stored procedure in sql server
How to get that resultset in dataset in C#
Thanks in advance
Gaurav
|
|
|
|
|
You can use SqlDataAdapter class to retrieve data into dataset using stored procedures
|
|
|
|
|
Use a SQLDataAdapter object, and use Fill() method to fill the dataset.
|
|
|
|
|
Hi,
If i have a 100*100 array of values (say 0 is black and 255 white), how do I display it as in image on a picture box ?
thanks,
Assi.
|
|
|
|
|
Create a Bitmap object and use the SetPixel method to set the color of each pixel.
If you need extra speed, you can use the LockBits and UnlockBits methods to access the pixel data more directly.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Append a bitmap header to a memory stream and then copy your array to the stream. Then create a new bitmap using the stream constructor. That will be the fastest way. See wikipedia for the format definition.
http://en.wikipedia.org/wiki/Windows_bitmap
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I am currently using the HTTPWebRequest class. I need to add the following to the request line:
POST /Search HTTP/1.1
It is simple to get 'POST HTTP/1.1' but i am having difficulty adding the additional string.
I cannot seem to get the '/Search' inserted in the request line. I understand HTTP 1.1 and the VERBS allowed as part of a request.
The 'method' property is used to set the VERB. Adding anything other than a single string throws a null reference exception. I have seen extra information appended to the method many times in the past so not too sure why this is so problematic.
I initially thought of overriding the HTTPWebRequest but as it is created from calling Create() on the WebRequest, this doesn't appear possible.
Thanks in advance.
Carl
|
|
|
|
|
As far as I know, you only have access to the Headers collection on the HttpWebRequest. You will probably need to write your own class for this functionality.
Luckily, you can use this post as a basis for getting that done. http://www.thescripts.com/forum/thread343158.html[^]
Good luck.
|
|
|
|
|
Hi Mike,
thanks for the post. I did something very similar already as a back up to the problem, using the TCPClient and NetworkStream. Created an additional HttpProtocol class and added all the members that might be needed. provided an override of ToString with booleans against each of the properties as to whether to include them in the ToString. Feels so cludgy though. plus it's a real pain interrogating the response headers and content. as it just comes back as a byte array.
still think there must be a better way.
thanks.
Carl
|
|
|
|