|
Hey, I need a regular expression that matchs to the following elements:
* the input string must have # in the start of it.
* the input string needs to be longer than 1.
eg.: #b <- ok; # <- not ok; b <- not ok; ## <- ok...
I just don't know how to use Regular expressions...
So thanks alot ^^.
NaNg.
|
|
|
|
|
This one works for me:
^\#[^\r\n]+.*
I had to add the [^\r\n]+ , because Expresso matches some character that simply wasn't after the dash, even when I appended a $ at the end
Or, without Regex:
string foo = "#asdf";
if(foo.StartsWith("#") && foo.Length>1)
{
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
@"^#.+"
... works for me (in code ... I don't know about Expresso). Remember, "*" specifies zero or more. The "." should not match \r\n unless you are using the RegexOptions.Singleline modifer.
- Bitwise
|
|
|
|
|
Hi there!
I have an application with 2 projects.
First project, I have a mdi form which is a Windows application i.e. I can't use it as a reference. This mdi form is the only item in my 1st project. In my mdi form I have a status bar.
Second project, this is a class library with Windows form, how do I access the status bar in my mdi form from my Windows form when I can't reference it?
Please help
sasa
|
|
|
|
|
You don't. Whatever your writing that is trying to update the statusbar should, instead, be exposing an event that the MDI form can subscribe to. That event should send the message as a String, or whatever else you want really, and the subscriber, namely the MDI Form, should update it's own status bar.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello i need to convert a control.CreateGraphics() for my app. VS2005 gave me a runtime error saying that it's not supported for Compact framework.
Is there anyway to bypass that?
Donkaiser
|
|
|
|
|
Oh I want to create graphics components on a panel.
Donkaiser
|
|
|
|
|
As far as I can see you should be able to create a Graphics object using the Handle of the control.
---
b { font-weight: normal; }
|
|
|
|
|
Unfortunatelly you can't.. When you make something like this :
Graphics g = Graphics.FromHdc(panel1.Handle);
It throws an exception "ArgumentException - Value does not fall within the expected range". And that's all. I have the same problem like donkaiser. I'd like to draw something on a tabControl or a panel and I don't know how.
|
|
|
|
|
I used the paint event of the tab. but my problem is that i need to update the drawing color according to my input data. how to raise the paint event again is still a mystery. I bypassed the problem with panel.invalidate() but now i have flickering problems.
Donkaiser
|
|
|
|
|
Invalidating the control is the proper way of making it redraw itself.
---
b { font-weight: normal; }
|
|
|
|
|
I try to implement double buffer but i can't get the handle of the SetStyle method
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
VS2005 give me the error saying that SetStyle and ControlStyles is not contained in the definition of the form.
how can i get the handle on this function to use on a panel to prevent flickering?
Donkaiser
|
|
|
|
|
Hi all,
Using Serial Port class in .net 2.0 i can able to connect with RS-232 only. is ther any API or way to communicate with RS-422 port...
Thanks and Regards,
Srini
|
|
|
|
|
Have you tried just using the Serial Port control to open the RS422 port.
It might work but maybe I'm thinking of RS485.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi Srini,
The SerialPort class in .NET 2.0 can only be used with COM ports. If your RS-422 controller uses "COM#" names and can be used with the normal Win32 API calls that you use on a COM port (GetCommState, PurgeComm, etc.), then you might be able to use it. Otherwise you'll just have to write your own wrapper around the RS-422 controller's API.
Hope this helps!
Erik
|
|
|
|
|
Hello,
I wondering how it's possible to unzip a file using C#. Simple unzip. Is it possible without third party components?
|
|
|
|
|
Natively... I don't know... But you can allway use SharpZipLib
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
I like use SharpZipLib[^] too. (clickity provided for your enjoyment)
Steve Maier, MCSD MCAD
|
|
|
|
|
Thanks but is there a .NET 2.0 version?
|
|
|
|
|
As other people have said there is a compression namespace and classes in .NET 2.0 now. But have you tried to download and compile the SharpZipLib with 2.0?
Steve Maier, MCSD MCAD
|
|
|
|
|
What platform are you using? 2.0 has compression built in.
|
|
|
|
|
2.0
Can you provide me with some resource please?
|
|
|
|
|
|
I am having trouble autoscaling dynamically created classes derived from UserControl in 120 DPI.
Here are the involved classes:
ClassA : UserControl
ClassB : UserControl
Dockable pane (from third-party)
In the dockable pane is object A (ClassA). ClassA.AutoScaleMode = Inherit and controls in object A are autoscaling correctly in 120 DPI. The AutoScaleFactor from the dockable pane is apparently being used to autoscale object A (which is good).
Part of ClassA's code:
ClassB B = new ClassB();
this.Controls.Add(B);
B.Dock = Dock.Fill;
B.BringToFront();
Problem: ClassB.AutoScaleMode = Inherit, but the controls in B are not autoscaling.
Any ideas?
CuePhoenix
|
|
|
|
|
Note: One way is to set ClassB.AutoScaleMode = Font. However, ClassB in my example represents the root node of a whole heirarchy of classes that use visual inheritance, so I'd have to change AutoScaleMode on each leaf class in the tree. I want to avoid that work if possible.
CuePhoenix
|
|
|
|