|
Hi,
I got it, could find a good example.
Thank you very much!
Harsh
jayasshc
|
|
|
|
|
I have wizard kind of windows application with many forms. I have set the form Location
this.Location = new Point(100, 100);
This works fine with single monitor. If the user connects to 2 monitors i want the form to be displayed in both the monitors. How can set the form Location? Also also if the user switches back to single monitor the Form should display in one monitor?
|
|
|
|
|
Screens.PrimaryScreen will give you the main monitor. All the screens in the collection will have locations relative, so you can position your window anywhere you like. Getting the same form to display on both monitors, is actually a setting in windows, which would make the full screen be cloned. Otherwise, you'd need to create two windows and have them mirror each other.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your reply.
As you mentioned "Getting the same form to display on both monitors, is actually a setting in windows, which would make the full screen be cloned."
I dint understand it clearly. Do you mean to say i cannot programmatically make the same form to display on both monitors? Or i need to change same settings in the Windows. How to do this?
|
|
|
|
|
Who have source C# for click'n'see or the program similar click'n'see?
Thanks
|
|
|
|
|
See'n'say? That's a hardware solution.
|
|
|
|
|
Well, I don't know, I've not heard of it. But, I recommend www.rentacoder.com if you're looking for full source code. Here, we help programmers who are stuck with their own code.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
QTrung123 wrote: Who have source C# for click'n'see
The manufacturers of the C# version of Click'n'see?
|
|
|
|
|
click'n'see is a program which can retrieve text under mouse!!!!
|
|
|
|
|
I am using third party control (Infragistics UltraComboEditor). Unfortunately, this control is not raising MouseWheel event with Mouse wheel is moved (may its a bug in control). How to handle global mouse wheel event?
Somehow i want to handle the mouse wheel moved event in my application, and will check whether currently the focus is in UltraComboEditor and act accordingly, is this possible?
Thanks
|
|
|
|
|
|
I have an interface library to a device and one function is defined as
unsigned short init(HANDLE handle, unsigned char* cFlag);
The cFlag is just a byte ([in] parameter), and not an [out] parameter and should not be a pointer. Expected values are 1, 2, 4.
If I create the following p/invoke...
[DllImportAttribute("if.dll", EntryPoint = "init")]
public static extern ushort init(IntPtr handle, IntPtr cFlag);
Now, how do I use it...
Case 1:
IntPtr handle = ...
IntPtr cFlag = new IntPtr(2);
int result = init(handle, cFlag);
Case 2:
IntPtr handle = ...
IntPtr cFlag = Marshal.AllocHGlobal(1);
Marshal.WriteByte(cFlg, 2);
int result = init(handle, cFlag);
Marshal.FreeHGlobal(cFlag);
Which is correct and recommended?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I want two merge two tables A & B. Table-A contains column A, B, C and Table-B contains column D, E, F. I want the result table to contain columns from both tables i.e., A,B,C,D,E,F. Is there a way to accomplish this in C#? I'll greatly appreciate any response.
|
|
|
|
|
How do rows in the two columns map to each other, so that such a join makes sense ? Where are the tables coming from ? The most sensible thing would be to write SQL to return a table that merges the two tables together, assuming there's a way of doing that logically.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I assume that you're saying you want to merge 2 System.Data.DataTable objects into one. If thats not the case forgive me...
If this data is coming from 2 separate, but related tables in your database, you can add them to a DataSet, and set up a DataRelation between the 2 tables.
This doesn't merge the 2 tables into 1, but it will allow you to retrieve the data for a particular DataRow in DataTable1, as well as the DataRows from DataTable2 that are related to it.
You can get the related row information by calling dataRow.GetChildRows(), dataRow.GetParentRow(), or dataRow.GetParentRows()
Hope that helps...
|
|
|
|
|
Thank you very much for your response. Yes, i want to merge 2 DataTable objects into one. I'll try the method you suggested. Thanks again.
|
|
|
|
|
Hello- Please help me with the following questions, if possible,
please also provide some explanations--thanks in advance:
1) Assuming that "valid connection string" is a valid connection string, what will be the output of the following code? If the code cannot compile, please state why.
the same rules apply to this question as for the one above
using(SqlConnection sqlConn = new SqlConnection("valid Connection string"))
{
System.Diagnostics.Debug.WriteLine("Opening a connection");
sqlConn.Open();
System.Diagnostics.Debug.WriteLine("Connection Opened");
sqlConn.Close();
System.Diagnostics.Debug.WriteLine("Connection Closed");
}
if(sqlConn == null)
System.Diagnostics.Debug.WriteLine("Connection State is NULL");
else
System.Diagnostics.Debug.WriteLine("Connection State:" + sqlConn.ConnectionState);
2)The following code needs to generate a string of 1000 alternating '+' and '-' characters
Rewrite this code to make it more efficient (Note: You can use different data types than the ones present)
string htmlOutput = string.Empty;
for(int itemIndex = 0; itemIndex < 1000; itemIndex++)
{
if( itemIndex % 2 == 0)
htmlOutput += "+";
else
htmlOutput += "-";
}
3)Assuming that CustomException is defined, what will be the output of the following code?
try
{
throw new CustomException("Something went wrong");
}
catch(Exception ex)
{
System.Diagnostics.Debug.WriteLine("Generic Exception has been triggered");
}
catch(CustomException ex)
{
System.Diagnostics.Debug.WriteLine("Custom Exception has been triggered");
}
4) What will be the difference in behavior between the lines marked 'a' and 'b' during runtime? (Assume that CustomClass is a defined class)
object objClass = new object();
CustomClass myClass1 = objClass as CustomClass; //a
CustomClass myClass2 = (CustomClass)objClass; //b
5) Assuming you have the following class:
public class MyClass
{
public MyClass()
{
}
public string DoNothing(string someParameter)
{
System.Diagnostics.Debug.WriteLine(someParameter);
}
}
How would you call the DoNothing function asynchronously and provide a callback?
6) What is the difference between a Monitor and a Semaphore?
7) Architectural Question: If you have pages that perform heavy DB or File I/O, what could be done to help increase the overall performance of the application? (Asp.net only! Assume all non asp.net factors have been optimized to the max)
8) What is the difference between the following 2 statements?
try
{
throw new ApplicationException("None");
}
catch(Exception ex)
{
throw ex;
}
try
{
throw new ApplicationException("None");
}
catch(Exception ex)
{
throw;}
9) What is the difference between a List and a LinkedList?
10) Assume that you retrieve a list of 1,000,000 Person objects from a database that contain the SocialSecurityID, First and Last name properties. Which collection class would you use to store and allow for quick lookup of Person objects based on the SocialSecurityID field?
A.Asif
A.Asif
|
|
|
|
|
Cross posting does not help get answers, it just annoys everyone.
only two letters away from being an asset
|
|
|
|
|
Like this was not annoying to start with ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
What on earth posesses you to think that we should do your test for you?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Do your own damn work.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello All,
I have created an application which shuttles messages via TCP/IP using C# and the System.Net class.
The application currently has a form which just displays information about the connection and the message.
I would like to recreate the application as a service but I am too much of a novice to know where to go. Can anyone of you give me a hint as to where I could find information on how I would go about this.
Any assistance will be greatly appreciated.
Thanks
|
|
|
|
|
Search the CodeProject site. There are plenty of articles are doing this.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Imho, you're much better off using WCF to do this. You can embed the WCF service host in a WinForms/console app or a Windows service with absolutely to changes.
/ravi
|
|
|
|
|
One way to do this is to create a project of WindowsService type and write your Main method code in the OnStart event
and just copy paste rest of your code .
|
|
|
|