|
If you use Regex.Split, you can use capturing groups to get the string you are splitting on in the result, or even parts of it.
Regex splitter = new Regex("(key)");<br />
string[] result = splitter.Split(theString);
---
b { font-weight: normal; }
|
|
|
|
|
Hey... So I'm pretty close to the ending of my project but now it's alot of problems.
I am following a link I'll give you in a sec, that tells the computer that files with endings of .ysl will open with my program.
so this is the link: http://www.codeproject.com/script/comments/forums.asp?msg=1479279&forumid=1649#xx1479279xx[^]
and this is the code I've generated:
Microsoft.Win32.RegistryKey YSL = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey(".ysl");
YSL.SetValue("", "YSL");
Microsoft.Win32.RegistryKey YSLSub = YSL.CreateSubKey("YSL");
Microsoft.Win32.RegistryKey DefaultIcon = YSLSub.CreateSubKey("DefaultIcon");
Microsoft.Win32.RegistryKey shell = YSLSub.CreateSubKey("shell");
DefaultIcon.SetValue("", Application.ExecutablePath + "0");
Microsoft.Win32.RegistryKey Open = shell.CreateSubKey("open");
Microsoft.Win32.RegistryKey Command = shell.CreateSubKey("command");
Command.SetValue("", Application.ExecutablePath + " %1");
Now I don't know if that's correct so that's why I need you here.
Another thing, is that I want to know if there is already that key, so I wouldn't run this twice.
If I'll remember on something else I'll add here.
Thanks, NaNg.
|
|
|
|
|
Has anyone else found a bug when setting the wrap mode to Clamp
LinearGradientBrush lb = new LinearGradientBrush(new Rectangle(0, 0, this.Width, 300), Color.FromArgb(199, 213, 254), Color.White, LinearGradientMode.Horizontal );
lb.GammaCorrection = true;
lb.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
this works in all aother enum values except Clamp.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Mainly I wanna check for what operating system the user is using.
Focusly I wanna check if a user has a Registry Keys (I assume there is only in Microsoft's products).
Can anyone help me with that?
I know it's not realy hard, but I'm looking at the focusly...
Thanks in advance...
NaNg.
|
|
|
|
|
Use : System.Environment.OSVersion.ToString();
|
|
|
|
|
I just spent a couple of hours reading about Windows forms and didn't find anything that tells me how I can pass some data, or a class, or an object, or something to a form.
Kinda miss the old days when you could just stash/pass pointers all over the place
Thanks
NIK
|
|
|
|
|
Here is one option
1) Expose a public property on the Form to hold/receive the desired data.
2) After instantiating the form object, but before calling ShowDialog, set the property with the relevant data.
Appears to work too.
|
|
|
|
|
3) Define a constructor that takes the desired data as parameter.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Too easy, too clean, no way )
So obvious, it never occurred to me, I'm still stuck in the old paradigm.
Thanks
NIK
|
|
|
|
|
Hi,
does anyone know how to get the language information for a given string?
thanks!!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
A string does not contain any language information. If you create a class with 2 properties (string and CultureInfo) then you can get the information of the string. Just look at CultureInfo to get the language.
|
|
|
|
|
Ok, I am having a problem with a workflow and need some thoughts!
I have a form that binds to a .Net 2.0 Dataset. This dataset is made up of 1 main table and 3 sub tables. I need to be able to do a insert into the first table of the main data, then insert the many-one rows for the sub tables.
How do I structure this using the DotNet 2 Datasets?, I don't want to do a mainform/subform flow, but a datagrid or something along those lines.
Suggestions??
Thanks;
Dave
You are only as good as your last project.
|
|
|
|
|
Hey, I want to have a help button (a button with "?"), but I can't find it...
How can I add it to my form?
|
|
|
|
|
Maybe the Form.HelpButton property?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Huhh? Didn't I try it?
guess so, cuz it didn't show before and didn't show now any button or any help.
|
|
|
|
|
Sorry, looks like the Minimise and Maximise buttons must be disabled for the help button to be displayed. Wierd but it works that way.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Been that way forever though. MS apparently always assumed that any nonmodal dialog would have a help menu instead.
|
|
|
|
|
Typical MS bull****
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Thanks guys but I found what I wanted...
I'll just use a toolTip... just didn't found it till now.
Thanks any-way...
NaNg.
|
|
|
|
|
I have created graphics on a tabpage but cannot get its autoscroll working at all.
Graphics g = tabPage1.CreateGraphics();
g.DrawString("Hello how are you?", new Font("Courier New", 10, System.Drawing.FontStyle.Regular), new SolidBrush(Color.Black), 10, 20);
tabPage1.AutoScroll = true;
Anybody know how to fix this problem?
|
|
|
|
|
AutoScroll is concerned with the location/size of child controls. Rendering a string onto a tabpage has no effect on the logical visible area required to show all child controls, so the autoscrolling is unaffected. I suppose that you could add a Label to the tabpage, set it's Text to the string you are drawing, and position the Label such that it is outside of the currently visible area of the tabpage.
Josh
|
|
|
|
|
Thanks. But it doesn't seem to allow using both label and graphics on the same tabpage !?
I used labels before but the display time was very very slow. So I changed to use graphics which can be displayed much much faster. I tried adding a label right after the last graphic object which should be outside of the currently visible area of the tabpage. However, all the graphic objects just blink & disappeared.
|
|
|
|
|
No, you have drawn something on the screen where the tabpage happens to be. Whatever you do to the tabpage won't affect what you drew. Actually, anything that makes the tabpage redraw will draw over what you drew.
If you want to draw something on the control, you have to use it's Paint event, so that whatever you draw will be redrawn when the control is redrawn.
---
b { font-weight: normal; }
|
|
|
|
|
How do I use paint event? When will the paint event be triggered?
I need to write different text on a tabpage line by line. Can the paint event draw different strings to a control?
Please help!!! I need a solution to it.
|
|
|
|
|
Does anyone Know where I can find a list of Messages that I can use with SendMessage function?!
Thanks
|
|
|
|