|
hello there
I want to add virtual printer to my system . and when any system user print the document. my application should recieve the bytes or what ever is sent by the application.
Any help would be highly appreicated
Best Regards
Rizwan Bashir
|
|
|
|
|
I want to check for a decimal number where one or more digits are allowed before the decimal point (in which case digits after the decimal point are optional) or one or more characters are allowed after the decimal point (in which case digits before the decimal point are optional). The decimal point is optional, but you cannot have just the decimal point.
e.g. 1.3, 1., .1 all ok.
. not ok.
The pattern @"^\d+\.?\d*$" takes care of the case where there are digits before the decimal point.
The pattern @"^\d*\.?\d+$" takes care of the case where there are digits after the decimal point.
Either one by itself is not sufficient.
I thought I could combine them to have an either/or expression the way you would have [a|n] to say either 'a' or 'n', by making them subexpressions like this:
@"[(^\d+\.?\d*$) | (\d*\.?\d+$)]"
It doesn't work, though. This matches on each digit and the decimal point. e.g., 30.5 give 4 matches - '3', '0', '.', '5'.
I can achieve what I want in other ways, but wondering if someone can tell me if there is a regular expression to do what I want and/or explain why the last pattern matches on each digit - I'm not seeing it.
Thanks.
|
|
|
|
|
hi all,
this image (http://img227.imageshack.us/img227/6070/notifyicon6kk.jpg) shows msn messenger contextmenu and my form's contextmenu.
the problem is: the options (Restore, Exit ... etc) are approximately in the middle of contextmenu when compared with msn's.
how can i align them (Restore, Exit options...) leftest part of contextmenu ¿
i couldnt change the padding from properties
help please ...
|
|
|
|
|
contextmenuitem.TextAlign - this is the property... search for what you need... I think it's middle right
|
|
|
|
|
How do I exit multiple, nested, methods when a condition is true?
For example, an event is invoked, then when x = 0, stop activity
<br />
void event1(...) {<br />
method1()<br />
}<br />
<br />
public void method1() {<br />
method2();<br />
}<br />
<br />
public void method2() {<br />
method3();<br />
}<br />
<br />
public void method3() {<br />
if (x == 0) {<br />
}<br />
}<br />
<br />
If x = 0, the "more stuff" should never be done.
I know I can exit each separately, but I would have to test x each time.
Thanks for any help.
bigiorno
|
|
|
|
|
void event1(...) {
if (method1())
{
}
}
public bool method1() {
if (!method2()) return false;
return true;
}
public bool method2() {
if (!method3()) return false;
return true;
}
public bool method3() {
if (x == 0) {
return false;
}
return true;
}
|
|
|
|
|
You could use a return code instead of using 'void' everywhere.
The return code would indicate if the method succeeded...
Your code would become:
void event1(...) {
if (method1())
{
}
}
public bool method1() {
if (method2())
{
return true;
}
return false;
}
public bool method2() {
if (method3())
{
return true;
}
return false;
}
public bool method3() {
if (x == 0) {
return false;
}
return true;
} another way would be to use exceptions which would make your code look like:
void event1(...) {
try {
method1();
}
catch (Exception e) {
}
}
public void method1() {
method2();
}
public void method2() {
method3();
}
public void method3() {
if (x == 0) {
Exception e;
throw e;
}
} Hope this helps...
RicoH
Don't think you are, know you are...
custom hardware & software - olloc.be
|
|
|
|
|
Do not work MVR 1000 sx(Canopus) with DirectX.Capture. Somebody know what's problem?
Sorry, my English badly.
|
|
|
|
|
Your best source of information is going to be Canopus. It's very unlikely that someone with MVR1000 experience will ever see your post.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi, any good ideas to go from DateTime.Now to an excel date number (e.g. 38871).
Thx.
|
|
|
|
|
Get the number of days since 1899-12-31.
---
b { font-weight: normal; }
|
|
|
|
|
|
I would like to dynamically create 'n' number of identical tab pages (different names). Ideally, I would like to copy a 'master' tabpage of controls "myTabPage1" that I have created in designer for each new tabpage.
I was thinking something like create and my new tabs to tabControl1 then,
<code>foreach (Control TabPage in tabControl1)
{
foreach(Control.ControlCollection childControl in myTabPage1)
{
childControl.CopyTo(TabPage.Controls.).......
}
}</code>
but I cannot see my way through this problem as I am new to c#.
Please help.
You can please some of the people all of the time and all of the people some of the time but not all of the people all of the time.
|
|
|
|
|
try
TabPage.Controls.Add(childControl);
or something like that...
|
|
|
|
|
Hi, I'm looking for some good training material/coursework for C#. I've already hit the books some, but I'm looking for something I can use on a resume. Any suggestions would be welcome. BTW, I'm looking for something at an intermediate level, hopefully something good for a transition from C++/MFC to C#. Thanks!
|
|
|
|
|
You are looking for some projects to build?
How about a digital timetracker, like in the offices that everyone needs to pass their card to let know when they come in and when they come out, with users and projects to work on, description on what they were wokring on, reports on projects and workers, and every-one who is registered can log in and work from home... you can use wither mdb or XML to save data.... I've done something very small like this...
|
|
|
|
|
hi all,
am fiddling with wmi and this code, when i watch it in task manager, continues to grow in size. once integrate i will not be polling this frequently but i still would like to avaoid a continually growing application.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Management;
namespace WMIPrinter
{
class Program
{
static void Main(string[] args)
{
Thread t = new Thread(new ThreadStart(Go));
t.Start();
}
private static void Go()
{
while (true)
{
Thread.Sleep(60000);
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT DriverVersion FROM Win32_PrinterConfiguration WHERE Name=\"HP Color LaserJet 4550 PCL\"");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("DriverVersion: {0}", queryObj["DriverVersion"]);
}
searcher.Dispose();
}
catch (ManagementException e)
{
Console.WriteLine("### EXCEPTION: " + e.Message);
}
}
}
}
}
any ideas please?
kind regards,
g00fy
|
|
|
|
|
Hi,
I have a problem with including a *.dll within a user control for C#.
ToolBox - Right Mouseclick - Add Items
= > over the browse button I select the library within the controls I want to use
and I get following error message:
The object with ID 119 implements the IObjectReference interface for which all dependencies cannot be resolved. The most instances of IObjectReference that have a mutual dependency on each other.
Does anyone know what this message should tell me and how I can get my user control?
thx
Martin
|
|
|
|
|
How to disable horizontal scrollbar in Firefox for textbox with multiline property
|
|
|
|
|
|
|
I ment forum, not form... go there and ask there... this is C# (winforms or programing)
|
|
|
|
|
|
Hi,
Can any one tell me explicit convertion of char array to string?
i have string str and char strdata[25];
now i want to assign strdata value to the string called str.
I'm getting error " cannot implicitly convert type 'char[]' to 'string' "
Any idea?
|
|
|
|
|
there is no explicit\implicit way on converting char[] to string, and overriding will cause a-lot of problems. just use this function (you can change and it's better to change the static in it):
static private string CtoS(char[] charArr)
{
string tmp = "";
for (int i = 0; i < charArr.Length; i++)
tmp = tmp + charArr[i];
return tmp;
}
NaNg
|
|
|
|