|
Is that one whole day to 3 whole days?
|
|
|
|
|
|
Is there a string method or some method in general that will allow me to read one character at a time from a string? I need to read a word and/or characters that is contained within single quotes from a string like this: "This is the 'message'". I need to extract the word message from the string. I tried using the split method, but I can't seem to be able to pass in a single quote as the delimiter. Thanks for any help.
|
|
|
|
|
Treat the string as an array of characters iterating from 0 to the string length.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
This is how you specify a single quote character: '\''
Luc Pattyn
|
|
|
|
|
This regular expression might be helpful:
Regex myReg = new Regex("'.*'");<br />
DestinationString = myReg.Match(SourceString).Value;
I'd like to help but I don't feel like Googling it for you.
|
|
|
|
|
Hi,
I have a .NET application which makes a call to 3rd party(Vertex) COM+ API's which requires to pass DSN Data source name, Database, userid, pwd to make a connection. I created a DSN data source manually now and everything works fine. I need to have this done programmatically to give as setup project
Question:
1. I need to create a setup project to create a ODBC User DSN like how u would do manually by going to Administrative Tools-->ODBC-->User DSN
2. I need to create a set up project to create a COM+ application project and register the COM+ API's. Currently, I have done this manually by going to
Component Services-->Computers-->My Computer-->COM+ Applications-->(New Project) and have registered.
Any help will be greatly appreciated.
Thanks
Bala
|
|
|
|
|
Q1: SQLConfigDataSource Function [^]
Q2: Sorry I can't help with this one...never done it myself, but you should be able to find an answer here: MSDN Enhanced Search[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thanks Eric. Will post the solution if I get the second question done.
|
|
|
|
|
Dear Friends:
How to draw graphics with real world dimension accuracy on different screens? For example, I want to draw a line to be one inch long (real dimension that can be measured with a ruler) on different resolution display screens? The code should result in the same one-inch long line on different size and different resolution display screens. Thanks!
Gshen
Sheng
|
|
|
|
|
|
Dear Ravi:
Thanks for your information!
The Graphics.DpiX and DpiY do not change with the size of the monitor screen. For example, A 17-inch monitor with 1280*1024 resolution and a 19-inch monitor with 1280*1024 resolution all have Graphics.DpiX and DpiY 96 dots/inch. If you divide the resolution by DpiX or DpiY, they result in the same inch dimension. But the real size of the 17-inch and 19-inch are different.
I guess the DpiX or similar paramter must be screen size and resolution dependent in order to accurately control the real physical dimension on the display screen.
Thanks!
Sheng
|
|
|
|
|
Good point. Perhaps the section "Coordinate Systems" on this[^] page will help? Sorry, I haven't hacked much GDI code using .NET.
/ravi
|
|
|
|
|
Have a look to Graphics.PageUnit property, some of its allowed values (Millimeter , Document which is 1/300 of inch) seem promising...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
to provide an acurate display, the operating system needs to know the resolution of your monitor.
For MS Windows (XP and others) the default value is set to 96 dpi, which used to be a good
average value before, but may be well below the actual value for a modern monitor.
The theoretical value you need equals the length of your monitor's diagonal in pixels
(this is the square root of horpixels squared plus vert pixels squared !) divided by
same diagonal's length in inches (14, 15, 17, 19, whatever).
Examples: 17 inch monitor with 1280*1024 pixels gives SQRT(1280*1280+1024*1024)/17 = 96.4 dpi !
but 15 inch monitor with 1400*1050 pixels gives 116.7 dpi
To change the setting: right-click the desktop, choose Display Properties, click Advanced button, and look for the DPI Settings combobox. The custom setting is expressed in % not in dpi,
so whatever you calculated you should multiply by 100/96 to get the right percentage.
Warning: if you never cared before, and now increase the dpi setting, every item on your
desktop will become smaller, but it is a required step to get acurate dimensions.
Remark: to counteract the reduction of font sizes, you can ask Windows to use larger fonts
on the desktop (see Display Properties, Appearance, Font size); you can also ask it to use
larger icons...
Luc Pattyn
|
|
|
|
|
Dear Luc:
Thanks for your post!
If I know the resolution and size of the target monitor, I can write the program easily and everything can be calculated correctly. But that's hard-coded. The question is that the program will run on different machines without knowing the resolution and size parameters in advance. The program must automatically figure out the resolution and size of the target monitor. How can I do that?
Sheng
|
|
|
|
|
You have missed my point. There are two steps involved:
1) you tell Windows what your resolution is, see my previous message (for each monitor
and each monitor involved). This is independent of any application.
2) your application(s) asks Windows what the resolution is, see a previous message by Ravi
(on Graphics.DpiX and Graphics.DpiY; which as far as I know, and unfortunately, always
will report identical values, since Windows is only interested in a single, diagonal,
resolution)
So there are no constants in your applications, but you have to calibrate each Windows
system once.
Luc Pattyn
|
|
|
|
|
Luc:
Thanks!
Is there any method which can programmatically read the horizontal and vertical physical dimension information of the target display from the Windows system?
If the program can get the physical dimensions at run time, the program can of course programmatically control the real physical dimension of the drawing.
Sheng
|
|
|
|
|
You need a Graphics object:
normally you get this in your Paint method, from PaintEventArgs.Graphics
alternatively you may have a look at Graphics.FromImage()
Luc Pattyn
|
|
|
|
|
Graphics.FromImage() does not provide the physical size infomation of the display.
Sheng
|
|
|
|
|
On my system, the following code prints "DpiX=135":
Bitmap bitmap=new Bitmap(100, 100);
Graphics gBM=Graphics.FromImage(bitmap);
Console.WriteLine("DpiX="+gBM.DpiX);
Luc Pattyn
|
|
|
|
|
I want to know which one is better. I see a better benefit on scripting, since any change on the database will enable you to change some code. Here is what I am talking about
Assume that I arleady know the database. For instance, I want to connect to an company database to read some information about employee names. Now, I can have a sample of that database and use a wizad to do that. Or I can use the oldbconnection and use sql command to do that. What I like with the wizard, is the fact that every field from the database can be pulled up with intellisense. And very easy to connect those field or the database to windows form component.
The problem I see in the wizard, if you don't know much about that dabase in advance and whant to read some field on it. I also see more people or book use the scripting than the wizard.
Anyway, all what I want to know which one is better to use; the database wizard or the sql command string which is related to ado.
|
|
|
|
|
I have a form where I don't want the user to edit any of the fields in the form - readonly. I set the panel.enabled to false. The fields are hard to read as they are light grey. Does anyone know how to change the .enabled font or a better way at doing this.
Thanks for everyones help.
|
|
|
|
|
the controls on the panel are are disabled because their value is set by their container. You might be able to override the graying of the text, by reseting the forecolor of hte controls to black after the panel is disabled. This is just a guess though, not something I've tested.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
well friends I'm a new bee to crystal reports here. Just started to work after reading a few articles from codeproject.com
what I wanna know is that can we show a picture from our database in to the crystal report. if yes... how?
oh by the way I'm using .net 2.0 and I think it must be crystal report 9 or something what ever comes with it u know.
thanks in advance but plz dont tell me its a C# forum.. I know that
Rocky
|
|
|
|