|
|
Try this..This is how i did...
call this function
BringEditorToFront(this); in ur Load..
This is the implementation of BringEditorToFront
private void BringEditorToFront(object objAttached)<br />
{<br />
<br />
<br />
Form parentForm = null;<br />
UserControl control = objAttached as UserControl;<br />
if (control == null)<br />
{<br />
parentForm = objAttached as Form;<br />
}<br />
else<br />
{<br />
parentForm = control.Parent as Form;<br />
}<br />
<br />
if (parentForm == null)<br />
return;<br />
<br />
int handle = 0;<br />
try<br />
{<br />
handle = (int)parentForm.Handle;<br />
}<br />
catch (Exception ex)<br />
{<br />
<br />
handle = 0;<br />
}<br />
if (handle != 0)<br />
SetForegroundWindow(handle);<br />
}<br />
<br />
<br />
public static bool SetForegroundWindow(int hWnd)<br />
{<br />
return Acc.Win32InteropLib.Win32Interop.SetForegroundWindow(hWnd);<br />
}
|
|
|
|
|
Thanks for both of your help.
I got it to work using the MessageBoxIndirect class as suggested by LedMike.
|
|
|
|
|
hi all,
anybody knows how to create xml attribute in c# with single quotation instead of double quotation as norm. Example :
|
|
|
|
|
Look at XmlTextWriter.QuoteChar
|
|
|
|
|
Hi guys,
does anybody know how to send SMTP mail in exchange 2003? I have my code working on 2000 but fails on 2003. Please help?
sasa
|
|
|
|
|
Hi friends,
Can anyone of u give me code example to make it clear that string is a reference type.
|
|
|
|
|
Hello,
string oldtest = "test";
object o = oldtest;
string newtest = o as string;
Would not be possible with an value type!
All the best,
Martin
|
|
|
|
|
Moreover strings have some interesting features.
string s1="Hi";
string s2="Hi";
Both s1 and s2 will point to same location.
Again if you say s2="Bye", memory is allocated of "Bye" and s2 will point to the new location.
Try to search on mutable and immutable properties of string.
That will give you a clear idea of strings..
Regards,
Arun Kumar.A
|
|
|
|
|
Tahnks a lot..ur reply(short and sweet) helped me a lot..
|
|
|
|
|
Hi,
Im trying to print out an image, but if it doesnt fit onto one page, i cut it up and place what evers left onto the next page.
Bitmap tempImage = new Bitmap(image, tempSize);<br />
RectangleF origRects = new RectangleF(0, 0, image.Width, image.Height);<br />
e.Graphics.DrawImage(tempImage, tempRect, origRects, GraphicsUnit.Pixel);<br />
<br />
if (tempImage.Height >= e.MarginBounds.Bottom)<br />
{<br />
int newHieght = tempImage.Height - e.MarginBounds.Bottom;<br />
<br />
tempRect = new RectangleF(0, newHieght, tempRect.Width, newHieght);<br />
tempSize = new Size((int)tempRect.Width, (int)tempRect.Height);<br />
<br />
e.HasMorePages = true;<br />
return;<br />
}<br />
<br />
e.HasMorePages = false;
The problem is that i draw the first page fine, but the second page, the image is the correct height, but instead of drawing the bottom half, it draws the top half of the image and cuts of what should be drawn.
Obviously, the cords are wrong, but what do i need to change?
regards,
Gareth.
|
|
|
|
|
Have you looked at Graphics.TranslateTransform ?
|
|
|
|
|
Hi friends,
why we are not using new keyword with string..
|
|
|
|
|
When creating new strings, you use the new keyword. Example:
string s1 = new String('-', 42);
When assigning a string literal, you are not really creating a new string object, just using a string object that already exists as a constant in the code. Example:
string s2 = "Hello world!"
When creating a new string by using a method that returns a string, the creation is done in the method, so you don't use the new keyword. Example:
string s3 = s2.ToLower();
When creating a new string by concatenating other strings, you are really using the String.Concat method. The + operator is shorthand for calling String.Concat. Example:
string s4 = s2 + s3;
string s5 = String.Concat(s2, s3);
---
single minded; short sighted; long gone;
|
|
|
|
|
Same reason we aren't using the new keyword with int, double, etc.: the value is often specified in-line; the new keyword would be unnecessary cruft.
Under the hood, of course, we are allocating a new string.
|
|
|
|
|
Hi,
Presumably this is a common enough problem, but I can't seem to find a neat way of doing it!
The problem is I need to convert a .doc file to a .pdf, on the server side - so I can't automate Word to do it (yes I'm aware it can be done with Office2007, which I have, but this app will have to be left unattended - this is not the designed use for Word).
Does anyone know of any open source tools that would be able to do this?
Thanks
What if the Hokey Kokey IS what it's all about?
|
|
|
|
|
Hi friends,
As System.Int32 is a struct(value type) while Object is a class..and its been said that Object is a base class for dot net classes..well its true bcoz even integer object shows all the properties and methods of object class..Now my Question is that whether stuct(System.Int32 here) can inherit any Class(object here)...?though its been clearly said that structs can not be inherited.
Reply Soon..Plz
|
|
|
|
|
Yes, System.Int32 is a struct. If you treat it as an object:
object o = 5;
An operation known as boxing occurs: new memory is allocated to hold an object, and the value of the integer is copied from the stack to the heap.
Search this site for articles on value and reference types for more info.
|
|
|
|
|
Hi all,
i am using clickonce Deployment method to update my windows application,
i have created a update buttion and when this update buttion is clicked the code written inside buttion will check update version and intemates the user.
BUT WHEN I IMPLEMENT ABOVE in my actual application its not at all installing,
wat could be the solution?
please help me
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Prashanth, are you receiving an error? Can you give error details, or alternately, show us the code that's failing?
|
|
|
|
|
if (ApplicationDeployment.IsNetworkDeployed)
{
// Get a reference to the current deployment
ApplicationDeployment current =
ApplicationDeployment.CurrentDeployment;
// Hook up async event handlers
// Check for updates asynchronously
current.CheckForUpdateAsync();
//if i found updated version i am updating clients software
}
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Ok - that doesn't actually download any updates; that just checks if there is an update and notifies you via the ApplicationDeployment.CheckForUpdateCompleted .
Can you tell me what's happening: is an error occurring? Is any of the event handlers being fired? Do you ever call ApplicationDeployment.UpdateAsync() method?
|
|
|
|
|
Try this:
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment.CurrentDeployment.Update();
}
|
|
|
|
|
Prashanth, please post here on the forums instead of emailing me. Posting on the forums allows other people to see the solution, helping others as well as yourself.
ClickOnce is a solid technology -- don't abandon it just because you had some problems getting it working right. It's going to be a lot of work to do your own deployment technology.
If you're absolutely set on doing your own, I cannot help; I've never attempted such a task.
|
|
|
|
|
Prashanth, have you read this article[^]? It covers every step on how to do application updates using ClickOnce.
|
|
|
|
|