|
The benefits of age and experience! (Or, being an old fart has some advantages, then...)
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
|
|
|
|
|
Hello, I'm kind of new in C#. How i be able to access a method from my mainform from another form inside another project, but the same solution, without having to create a new object instance of the mainform?
for example, my mainform from project MainModule has a method to localize data, something like this:
public void LocalizeData(CultureInfo culture)
{
//codes here
}
How can i Access that from another project ModuleBody:
public void submit_click(Object sender, EventArgs e)
{
//How to access LocalizeData Method
}
Please help. Thanks.
|
|
|
|
|
If the code is common (ie the same in each case) create a new class with the localisation code in. You will almost certainly need to pass in the instance of the form you want to be localised.
e.g. [Psuedocode]
public class Localizer
{
Form FormInstance { get; set; }
public void LocalizeData(CultureInfo culture)
{
}
public Localizer(Form formInstance)
{
FormInstance = fromInstace;
}
}
|
|
|
|
|
I write windows service but I can't install it on windows 7.
What is the diffirentation between windows 7 and other windows OS when install windows service?
|
|
|
|
|
None, AFAIK.
What error are you getting? Are you sure you are using administrative privileges when istalling the service?
|
|
|
|
|
I don't get any error. I install windows service using with installutil but I can't see my installed service in the windows services.
I use same code on different windows OS, its work.
|
|
|
|
|
Hi,
How do I get Excel Application object in automation add-in that is passed from VSTO Excel add-in 2003?
Thanks in Advance
|
|
|
|
|
HI,
In a special case in our project i have to draw around 180,000 rectangles on the window, Its taking almost 2 seconds to do it, and it has zoom and scrolling features too. Is there any way to impove the performance.
Thanks
ravi
|
|
|
|
|
|
double-buffering improves the visual experience, it does not really change the execution speed.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Thanks, I know that.
The OP was talking about zoom and scrolling features. I decided that double-buffering technique could greatly improve the visual experience when using these features.
Thanks
Nuri Ismail
|
|
|
|
|
That is a lot of rectangles, are you by any chance using them to represent a grid? If so then you could try using lines to draw the grid, this would reduce the number of draws to ~900. If not a grid, then what needs so many rectangles?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Perhaps you can draw it in a separate thread and pass the resulting picture back to be used as a background for the Window?
I are Troll
|
|
|
|
|
Hi for all
im now tring to redirect my project to PHP page from C# APP
and i used these lines (code):
// prepare the web page we will be asking for
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("http://localhost/d.php");
// execute the request
HttpWebResponse response = (HttpWebResponse)
request.GetResponse();
that executed my program without showing me a PHP page in my browser
and i used these lines also as my code
string targetURL = @"http://localhost/MyPage.php";
System.Diagnostics.Process.Start(targetURL);
and that run true but i prefer the first method to do that
So any help
Thanks in advance
|
|
|
|
|
Hi,
the first method will not open a browser, because you are doing a http-request. This means you call the site like a browser. The second call opens the browser because the operating system will open the browser to handle the command (in this case an url) you passed.
For displaying the php-page within your app you could use the webbrowser-control.
Regards
Sebastian
|
|
|
|
|
Hi All
I'm create a system of medium-sized
I want to be the system of bilingual Arabic and English
I want to do the work Mithod GENERAL Oqo Bmnadadtha screen present in the system
How Ostzia of change in the screen from right to left or vice versa
Has been used following code but all the screen using this code to close immediately after opening
if (Arbic)
{
Form.RightToLeft = RightToLeft.Yes;
Form.RightToLeftLayout = true;
}
else
{
Form.RightToLeft = RightToLeft.No;
Form.RightToLeftLayout = false;
}
thanks
Thaer
|
|
|
|
|
You should look at using Internationalization. This will greatly cut down the work you need to do.
This link[^] has a section on Arabic support. here[^]
|
|
|
|
|
Hi,
Am trying to update a database, setting a datetime value to the value set on a datetimepicker, and every time I try it, I get the following error message
ERROR[HY000][DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Statement not allowed in readonly isolation level (7671)
Is it possible to override this isolation level, and if so, please can someone point me in the right direction of how?
With thanks in advance
Scott
|
|
|
|
|
Does anyone know how to get an thumbnail of an Form thats Minimized
This code works ok when the form is normal or maximum size, but not when its minimized, or anything in front of it.
private Bitmap GetFormImage(Form formToCapture)
{
Bitmap formImage = null;
using (Graphics g = formToCapture.CreateGraphics())
{
formImage = new Bitmap(formToCapture.Size.Width, formToCapture.Size.Height, g);
using (Graphics mg = Graphics.FromImage(formImage))
{
IntPtr dc1 = g.GetHdc();
IntPtr dc2 = mg.GetHdc();
BitBlt(dc2, 0, 0, formToCapture.ClientRectangle.Width, formToCapture.ClientRectangle.Height, dc1, 0, 0, 13369376);
g.ReleaseHdc(dc1);
mg.ReleaseHdc(dc2);
}
}
return formImage;
}
Appreciate the help...
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
You could try showing the form, get the image, and then minimize it again
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
This is not posible... but a good alternative... thanks for the reply...
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
The Form class, like all Control descendants has a ToBitmap method, I don't know if you might be able to make use of that.
I hesitate to expand on my answer, since to me a Minimized Form has no graphical representation to put in an image. When minimized a Form is only shown in the TaskBar, and then only if the appropriate properties are set.
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.”
|
|
|
|
|
You are absolutly correct on this, the form has not graphical representation, but how does M$ do it, when you look at vista or win7 thay can make an thumbnail of an window thats minimized... Thanks for the reply...
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Paw Jershauge wrote: but how does M$ do it, when you look at vista or win7 thay can make an thumbnail of an window thats minimized
If I knew that, I'd probably be working for them. Unfortunately I don't.
However, I have just found this[^], which refers to a SetIconicThumbnail method, which sounds, sort of, like it might be what you need.
Good Luck!
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.”
|
|
|
|
|