|
The point is, that you reapply the highlighting after each undo operation.
|
|
|
|
|
Hi All,
I have set paper size for printer. so i am setting as follows:
e.PageSettings.PaperSize.Height = 850;
e.PageSettings.PaperSize.Width = 1100;
but when i run my application and try to take print out, it gives an Exception like "Paper Size can not be change unless the kind property is set to custom"
can any body please tell how can set this kind property to custom.OR any other method to set page size.
please share your knowledge.
thanks
Bankey
|
|
|
|
|
e.PageSettings.PaperSize.Kind = PaperKind.Custom
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thanks for quick reply,
e.PageSettings.PaperSize.Kind = PaperKind.Custom;
but it giving an error, because it read only property....
can not be assign, can you please tell me what i have to do for that...
thanks
|
|
|
|
|
|
Hi,
Is there a way to set the size of the form (in a Windows application) to the same size as the screen's resolution?
Thanks.
|
|
|
|
|
|
|
|
|
You could always use the following code:
Height = Screen.PrimaryScreen.Bounds.Height;
Width = Screen.PrimaryScreen.Bounds.Width;
|
|
|
|
|
Thanks,
This is a good answer but it doesn't substract the task bar size.
Is there a possibility to perform like the maximize fuction?
|
|
|
|
|
Ahh - so you want it to look like it's maximized. If you want it to fill the screen, but don't want it to be maximized (i.e. you want to emulate the way office works) change Bounds to WorkingArea .
|
|
|
|
|
Hi,
C# VS2005
Im using web services to return custom objects. I want the database connection from the gui to remain persistent.
(The gui creates a connection and the idea is that the web service always uses this connection)
If I pass the connection object (Type System.Data.OleDb.OleDbConnection) to the web service as a parameter I get the error:
Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface
Is it possible to pass database connections to web services or how can I ensure the web service uses a persistent connection??
Thanks,
Chas
|
|
|
|
|
You should never try to make a connection persistent with web services. You're totally defeating the benefits that you get with a disconnected architecture. Please - think this through, and then change your architecture to fit the n-tier model, so you acquire your connection as late as possible and release it as early as possible afterwards.
|
|
|
|
|
Instead of trying to pass a connection to the web service, how about just declaring a new connection in the web service class iteself. Lets say, in its constructor would be a good practice.
Try it before its too late coz it works inline with time.
Morg.....
|
|
|
|
|
Hi everybody,
it's probably a stupid question but i hope someone can help me .
I have the following situation:
A TAPIClass which gets an eventhandler (which himself gets events from the phone)
I created a class CPhone which should store the instance of the TAPIClass.
In the constructor i create the TAPIClass instance and initialize it.
The CPhone instances are created into a thread which is created this way:
new Thread(new ParameterizedThreadStart(TelSignalThread));
where TelSignalThread is a static function of the Main-Form which creates
an instance of the CPhone class
public static void TelSignalThread(object param)
{
MainForm Win = (MainForm)param;
CPhone tel = new CPhone(Win);
while(Win->Running)
{
Threading.Sleep(10);
}
}
My question is, how is it possible to call a function from CPhone from out the MainForm?
Call the GUI from out the Thread works with Invoke.
Edit: Or is it the best way to derive my CPhone-Class from the class Thread and to add class-members<br />
to the CPhone class? Does exists a PhoneThreadInst->Invoke(...); ?
Before i created this thread and the CPhone-Class, i had the TAPIClass into the MainForm, without a special thread and it worked great.
Then i needed to open a new window from a button-click during a phone call.
This provokes sometimes a event-lost from the TAPIClass , and a missing "hang-up Event" disturbes my whole appliction
Big thanks for any help
|
|
|
|
|
If you just want to call a function in CPhone form outside the class,
you can expose the fucntion by making it static.
Why do you want to use a thread to create the TAPICalss??
Did you try to use the BackgroundWorker threads ??
Missing of the event is very uncertain , dont know why it occures .
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
Thanks for your answer,
i create it in the thread for the reason that the instance is executed in another thread than the
GUI-Thread.
Probably there is a timeout or a "black hole" where the Hang-Up-Signal disappears if i open a new Window.
Actually it works with the Telefony-API into the thread.
But it worked also without a thread, but sometimes it makes problems
Now i need to test if this error occurs also with threading ...
|
|
|
|
|
On disk sometimes I have filenames that show up like ûÓÐÈË¿ÉÒÔ½ÐÄ㱦±´. However it should really be this: 没有人可以叫你宝贝. (Others are displayed correctly, so it is not a problem of the system).
I can copy the garbaged filename to a text file, open it in a browser, change the codepage to gb2312 for display in the browser, copy the displayed Chinese characters and rename the file. (I currently do not see through what the browser does)
This is not applicable for more than a few files.
So I want to automate it.
(I have a european Windows XP environment, should be the same with English)
Is there any tool, that does it? Or how can I do what the browser can do by C# coding? (the encoding part is sufficient).
Tried the encoding class but did not get any usable result. Please help. Thanks.
|
|
|
|
|
That's interesting. I'm not sure what the problem is though. Just created a file named 没有人可以叫你宝贝.txt on a German XP (hope it doesn't mean anything nasty), and in Explorer it shows up as a sequence of squares. This looks like a system thing indeed, cause the file name is correct (as I can see when I drag it into Firefox, which shows 没有人可以叫你宝贝.txt in the address bar).
Is this the phenomenon you mean, or do your files also have a different name? And if so, can you reproduce it?
|
|
|
|
|
Did you install your Windows' option "support for East Asian languages"? If so the filename should display as I have posted before.
If you are using Tools instead of the Windows Explorer, it might be that they are not able to display double byte characters and will display symbols instead. Total Commander should work with it but some of its functions do not.
|
|
|
|
|
No, I have no support for Asiian languages installed.
Anyway, if it's actually about encoding, did you try something like this:
string source = "ûÓÐÈË¿ÉÒÔ½ÐÄ㱦±´";
Encoding sourceEncoding = Encoding.Default;
byte[] bytes = sourceEncoding.GetBytes(source);
Encoding targetEncoding = Encoding.GetEncoding("gb2312");
string target = targetEncoding.GetString(bytes);
|
|
|
|
|
Thanks a lot!
That seems to work. My problem was, that I did not find Encoding.Default. Had tried all others, but .Default is obviously the remedy.
|
|
|
|
|
I need to print 1 record per page (invoice type) in crystal report? i have set the report to A5 for a custom width and length.
Got a Parent/child relation as my data source.
formatted the report this way:
Customer Name Date
transaction 1
transaction 2
transaction 3
...
Note: i have tick the [New Page After] in detail section, but to no avail its not doing what i think it should be doing.
been googling this since this morning but have not found any descent solution in doing this.
any help or a site is highly appreciated.
Life - Dreams = Job
TheCardinal
CTC-RDG
|
|
|
|