|
RichTextBox.ZoomFactor is also between 0.64 and 64.0 because it simply uses the EM_GETZOOM and EM_SETZOOM message which it sends to the underlying window handle, same as practically all the controls in Windows Forms.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
Thanks for the info. using EM_SETZOOM should give the same result.But it does not work
I tried to catch the EM_SETZOOM using the following code
Did I go wrong somewhere in implementation?. Please comment.
protected override void WndProc(ref System.Windows.Forms.Message m)<br />
{<br />
<br />
if (m.Msg == 0x04e1)
{<br />
return;<br />
<br />
}<br />
else<br />
{<br />
base.WndProc(ref m);<br />
<br />
}<br />
<br />
}
Where as catching WM_MOUSEWHEEL and asserting Control.ModifierKeys == Keys.Control solves the problem.
Thanks and Regards,
Jay.
|
|
|
|
|
I've tried a few things to and it's my educated guess that the Rich Edit control (which is encapsulated by the RichTextBox ) doesn't use the EM_SETZOOM when using Ctrl + Mouse Wheel and instead handles that internally in much the same way the handler for EM_SETZOOM does.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
Thanks a lot for sparing your valuable time to solve the problem.
Warm Regards,
Jay.
|
|
|
|
|
"How to develop a screen saver in C# By Rakesh Rajan" is the template I've been using to for multiple monitor support, but when i try to implement it into my code only one monitor pops up with screensaver and when i do either mouse event or keyboard event that monitors screensaver kills and then the other monitor pops up with screensaver. I'm guessing that it won't load next screens form until current form is termated. Here is the code...
for(int i=Screen.AllScreens.GetLowerBound(0);
i<=Screen.AllScreens.GetUpperBound(0); i++)
Application.Run(new ScreenSaverForm(i));
Do i use a thread or something.. been workin on this last part of project for a while now.. any suggestions
FYI.. I'm not rich. My desktops motherboard died and i just plugged monitor into back of laptop.
Codemonkey
pgf_codemonkey@hotmail.com
|
|
|
|
|
Application.Run is a blocking call that starts the message pump and wants until the main form is closed. Since this is in a loop, when the main form is close then the next iteration of your loop executes.
You should instead design your form to span multiple monitors (see SystemInformation.VirtualScreen ).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath,
How would you push applications to a specific monitor and not just stretch the screen space?
This sounds interesting for a project I'm doing.
Regards,
Eric C. Tomlinson
Silence is golden, so shut the heck up!
|
|
|
|
|
You can use the Screen class. See Screen.AllScreens , which is a static property that returns a Screen[] array.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the great hint. I appreciate it.
Regards,
Eric C. Tomlinson
|
|
|
|
|
Hi,
I got a question like this:
Q : You create an assembly by using Visual Studio.Net. The assembly is responsible for writing and reading order entry information to and from an XML data file. The assembly also writes and reads values from the Windows registry while it is being comsumed.
The assembly will be distributed to client comoputers by using your company intranet. All client computers are configured to implement the default .NET security policy.
You need to implement security in the assembly. What should you do?
a. implement declarative security and execute the permission demand to allow access to the file system and windows registry.
b. implement declarative security and execute the minimum permission request to allow access to the file system and windows registry.
c. implement imperative security and execute the permission demand to allow access to the file system and windows registry.
d. implement imperative security and execute the minimum permission request to allow access to the file system and windows registry.
Which one is correct? and Why?
Thanks a lot!!
|
|
|
|
|
alanshen209 wrote:
Which one is correct
b
alanshen209 wrote:
Why?
Declarative has bettter performance than imperative and it didn't want any custom security so we use this one. I think we have to use minimu permission cause it has to be used through intranet, so it need to use tighter security.
Mazy
"I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein
|
|
|
|
|
Hello there
My friends and I are going to make an PocketPC application with c#. But at the moment we do not know if we will need an device for testing pusposes.
We figured out that there is an emulator "shipped" with the sdk but is this emulator enough for testing pusposes?
Our application will have an server / client architecture were the pocket pc is the client and receives / send information via LAN.
At the moment this is a new expierence for us because we have never made an working c# / pocketpc application. we are used to java programming from school therefor the change to c# wasn't that hard , but we don't know the details from c# about pocketpc application development.
i hope i have hit the right forum for my question.
thanks in advance
|
|
|
|
|
If you installed VS.NET 2003 with the default options, you already have the Smart Device Extensions and an Emulator. You can also get the emulator from the Windows Mobile for PocketPC 2003 SDK (there's ones for PocketPC 2002 as well, though that NetCF is beta and will never be released).
The emulator is just that - it emulates the hardware and has an actual PocketPC image installed on top of it. So long as the OEM didn't rebuild it with missing critical system packages, you should be fine. Note, then, that it's not really the OS that's being emulated, it's the hardware with the OS installed.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i just recogniced that i have only visual studio.net , at the moment i am using the school licensed version... i'll get my professional 2003 in the next weeks.
But if you say it's all included with vs.net 2003 than our problems are solved and we are able to save a lot of money
thanks for your fast answer.
|
|
|
|
|
Save money? It's all free (well, except VS.NET 2003 unless your school can get it for you for free).
The PocketPC 2002 SDK and emulators can be downloaded for free, though you can also order them on CD for the price of shipping and handler. If you can manage to find the NetCF 1.0 beta (which worked within VS.NET 2002), you can use that to target the emulators for PocketPC 2002 as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
yes we are safing the money for an pocketpc , but the vs.net2003 we'll need to buy because we are going to sell the application. this project is some sort of learning for our future. we are doing this for fun while we make our military / socialwork service and later when we are on the university.
|
|
|
|
|
Hi,
I am trying to develop a custom metadata editor for ArcCatalog(ArcGIS), using VB.NET. I am using a COM component into my application. i am using esriObjecLibrary 1.0 into my reference, and its a .dll project, using VisualStudio.NET 2003. this metadata editor will be a pluging into ArcCatalog.
after writing the code, when i compile the project it says "Unable to emit assembly: Referenced assembly 'Interop.StdType' does not have a strong name"..
I went to the DOS prompt and gave a strong name to the assembly and added the assembly file into my AssemblyInfo.vb file, but still its not working.
if any of you have worked on this and know much about it, i will appreciate ur help...if u have worked on similar problem using C#.NET that will be of much help...
Thanks
software Used:
Visual Studio.NET 2003
ArcGIS 8.2
VB.NET
Platform: win2k
abhishek
|
|
|
|
|
Create a key pair using sn.exe -k KeyFile.snk. When you generate an interop assembly, use the /keyfile:<filepath> switch to both tlbimp.exe and aximp.exe (if importing an ActiveX control to derive from AxHost as well). If you're doing this from within VS.NET, go to the project configuration and in there is a place you can either entire a file path (relative to the project root) or a key container name. I typically install my key into my machine store using sn.exe -i KeyFile.snk MyContainerName (obvious use a container name you want).
I would delete the interop assemblies you've already created and regenerate them as I've mentioned here. Also be sure you use a key pair (possibly the same one - it helps identify your assemblies, though it's not verifiable like X.509 certificates). A strong name requires that the assembly be signed, which you seem to already know. A strongly named assembly can only use strongly named assemblies.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
A quick question about the oleDbDataAdapter. Is it a good idea to use these in threads to update a dataset? I notice that if I am running concurrent threads where each uses an adapter to fill a dataset, the first thread will work, and the second thread (different adapter and dataset, but same connection) will run, but nothing will be put into my dataset. Obviously the second thread cannot fill its dataset because the connection is open from the first thread. I understand why the adapter isn't filling my dataset, but I'm sort of shocked it would just skip the fill command without giving any indication that it did so. What is the int that the Fill function returns anyway? Can I use that number to determine if the function actually did its job? And if so, what would be the best way to go about using adapters in threads...right now I'm locking them down until the connection is free...is there a better way? Just curious, thanks a bunch!
|
|
|
|
|
When using the System.Data.OleDb classes, your options are limited because of the abstraction that OLE DB provides (basically the whole purpose of its existence). With the System.Data.SqlClient classes this really isn't a problem.
You might check if the OLE DB provider for whatever you're connecting to supports connection pooling or limitations that might help in this situation. The properties that you pass to your connection string are used by the OLE DB provider for your data source.
Other than that, locking against a shared resource (such as a static property of some class) or using a delegation approach to create and execute commands and / or adapters (and synchronizing them internally) are about your only options. It's the OLE DB provider for your data source here that is the problem.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've been writing a desktop sharing engine for .NET (pcanywhere sort of deal) . . . and I rely on the region class heavily for accumulating change rectangles (which I pull from the region class using the GetRegionScans method). I recently ran into the memory leak bug located in the GDI+ GetRegionScans call (see http://www.bobpowell.net/getregionscansbug.htm [^]for more details). Has anybody found a reasonable alternative to this bug? If not, any ideas or documentation on region minimal spanning rectangle algorithms?
Thanks!
-Guy
Senior Research Scientist
http://www.perspectivelabs.com
|
|
|
|
|
There must be a way?
I've written many "NT Service" programs with VB6 and most have some sort of user interface. They all have an icon in the tray to indicate 'I'm running'.
Now comes C#. I've written the service and installed it, but I'm having one hard time trying to figure out how to have some UI involved. I've triggered threads in the onStart() that toggle between a non-visible form which holds a notifyicon and a UI. Clicking on the icon shows a form, closing the form reloads the icon in the tray, perfect. However, after logging off then logging back on the icon moved to bit heaven, I'm assuming because there was nothing left to hold it and I don't know how to reload the form from within its called method.
In VB6, its as simple as using a timer to keep attempting to put the icon in the tray. If there's an error nobodys logged in, no place to put the icon, so try again in a few seconds. When there's no error, someone must have logged in.
I don't know how to see if a user has logged on to re-start the method I don't know how to write!
There's got to be a way to simply have a "service process", owned and operated by the 'system' display its own icon from its own process when it knows its running and have it be there after a user logs back on. I stress owned by the "system" because due permissions available on the target machine, the polling of service manager with normal user rights can not be done. These boxes are really locked down, so the administrator has to install the program and the system has to run it.
Can anyone please help?
|
|
|
|
|
|
I have two separate combo boxes and I would like to create one function to populate them.
I would like to be able to pass a combobox control and use it.
I.E.
void LoadDD(<no sure=""> <ddname>)
{
string[] dirs = Directory.GetDirectories("\\Family");
foreach (string dir in dirs)
{
<ddname>.Items.Add(new ListItem(GetName(dir), dir));
}
}
Any ideas??
|
|
|
|
|
You almost had it. If you want to tie the method to a particular control:
void LoadData(ComboBox box)
{
string[] dirs = Directory.GetDirectories("\\Family");
foreach(string dir in dirs)
{
box.Items.Add(new ListItem(GetName(dir), dir));
}
}
- Nick Parker My Blog | My Articles
|
|
|
|