Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
R

Robin Panther

@Robin Panther
About
Posts
32
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • numeric conversion for if check
    R Robin Panther

    If you are using .NET 2.0 - why not use Int32.TryParse()? short outint; if (!Int16.TryParse(tbStockTypeId.Text, out outint)) { throw new ArgumentException("Argument is not integer", "tbStockTypeId"); } //use outint ____________________________________________ Robin Panther http://www.robinland.com

    C# help

  • how to write >, <, &to XML file
    R Robin Panther

    there are some characters that has special meaning in html/xml files, for example <, >, & and so on. So, if you need to display such character in xml/html file you should use one of the special form of symbol writing, for example '&' followed by character short form and followed by ';'. '&' gt ';' for 'greater' sign. When you are reading html/xml file you have to decode such symbols. In your case, if you have only this three symbols in your file - you can make simple replace, either through string.replace(), either through regex.replace(). But if you can get more symbols (probably, all special chars) - then use standart functions - parse xml file into set of xml element object (or any other way) and read it's InnerText property. Notice, that if you'll write special chars into InnerText, and read it from it - It'll be ok. XmlDocument doc = new XmlDocument(); doc.LoadXml("" + "some textmore text" + ""); XmlElement elem = (XmlElement)doc.DocumentElement.FirstChild; elem.InnerText = "testing < > &"; MessageBox.Show(elem.InnerText); MessageBox shows "testing < > &" ____________________________________________ Robin Panther http://www.robinland.com

    C# question xml tutorial

  • DLL question
    R Robin Panther

    If you need Win32 dll - you can't create it in c#. You have to make it in c++ or any other native language. About using Win32 dlls from c# - search for Platform Invoke (p/invoke). This can be useful, for example If you need .net dll - just set in project properties, on Application tab, "output type" property to "Class library". Using .net dlls on design-time is very easy - add reference to needed dll and use it through Namespace.Class.Function system. For example, if your dll contains function ShowReport() in class Report in namespace MyReportNamespace, you just have to call for MyReportNamespace.Report.ShowReport(). About showing dialog - I don't know what about CrystalReport, but I've used a lot of forms, called from dlls. ____________________________________________ Robin Panther http://www.robinland.com

    C# tutorial question csharp c++ com

  • Enumerator question
    R Robin Panther

    looks like you get an error when lastVisited is -1. Probably you have to do something like this: public object Current { get { if (lastVisited == -1) return null; return list[lastVisited].thisBar; } } ____________________________________________ Robin Panther http://www.robinland.com

    C# help csharp java question

  • How to count number of word in text
    R Robin Panther

    Why don't you try using string.Split(" \t\n.;:\"\'") with cleaning empty results? may be some more symbols, but you got the idea. You can use Regex for same effect... ____________________________________________ Robin Panther http://www.robinland.com

    C# tutorial

  • I want to installed product.. but....
    R Robin Panther

    Looks like I guess what do you want. If you need the list of all applications, officially installed in the system, you'll need to parse system registry key HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall. If you need all applications installed and used in the system - it's impossible. ____________________________________________ Robin Panther http://www.robinland.com

    C# csharp dotnet visual-studio adobe sysadmin

  • Using .rar/.zip documents
    R Robin Panther

    zip lib for .NET - SharpZipLib And I never heard about free fullfunctional rar lib... By the way, UnRar.dll supports extraction from password protected files. At least, my password protected rar archive was successfully extracted using sample solution, coming with unrar.dll... ____________________________________________ Robin Panther http://www.robinland.com -- modified at 6:43 Friday 21st April, 2006

    C# com

  • setting new interval value and turning on timer in Parent Form
    R Robin Panther

    I'm pretty sure that "this.Owner" is null on this step. Either you forgot to set Owner property of your child form, either you show child form through ShowDialog function without argument. Check this out first. ____________________________________________ Robin Panther http://www.robinland.com

    C# xml help announcement

  • Threading help?
    R Robin Panther

    You could try to use System.Threading.ParameterizedThreadStart instead of ThreadStart if you are using .NET 2.0. If not - declare your ArrayList on class level (not inside function), and just call it from your thread... but be carefull to avoid cross-threading problems... ____________________________________________ Robin Panther http://www.robinland.com

    C# help tutorial question

  • Windows Desktop Shortcut list
    R Robin Panther

    Probably you should get list of *.lnk files in desktop directory: DirectoryInfo di = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); FileInfo[] fi = di.GetFiles("*.lnk"); Keep in mind, that system links (My computer, My Documents) has no lnk file. Then, for each lnk file you should call shell function CreateShortcut: IWshRuntimeLibrary.WshShellClass ws = new IWshRuntimeLibrary.WshShellClass(); IWshRuntimeLibrary.IWshShortcut sc; for (int i = 0; i < fi.Length; i++) { sc = (IWshRuntimeLibrary.IWshShortcut)ws.CreateShortcut(fi[i].FullName); } Don't forget to add reference to %system32%\wshom.ocx. sc object will hold all information about link: sc.TargetPath - link target sc.Arguments - launch arguments sc.IconLocation - string, that could be used to get icon. These two articles could be helpful for icon extraction: Win32 .NET Hope it helps. ____________________________________________ Robin Panther http://www.robinland.com

    C# question database

  • Retrieve shortcut(.lnk) target location
    R Robin Panther

    If you use Shell interface function CreateShortcut with name of existing link as argument - created WshShortcut object will be filled with shortcut information. sample: IWshShell ws = new IWshRuntimeLibrary.WshShell(); string shortcutFile = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "\\" + "ToDo.txt.lnk"; IWshShortcut sc = (IWshShortcut)ws.CreateShortcut(shortcutFile); after that sc.TargetPath will contain link target. Of course, if you have ToDo.txt shortcut on your desktop :). Don't forget to add reference to %system32%\\wshom.ocx and add "using IWshRuntimeLibrary;" Hope that helps. ____________________________________________ Robin Panther http://www.robinland.com

    C# help question workspace

  • Transperent window
    R Robin Panther

    try to search for shaped forms... like this or like this ____________________________________________ Robin Panther http://www.robinland.com

    C# question tutorial

  • Passing data from a form???
    R Robin Panther

    If you want to send some data to another object - you have to have reference to this object. In your case this means that your myForm should have reference to base form. something like this: call the form using myForm.Show(this) or set myForm.Owner = this just befor calling. Then, on button clicks, you could do something like this: ((OwnerForm)Owner).OkButtonIsClicked(); You could get values of textboxes of myForm if their modifiers are internal or public, but yYou could do it only if OwnerForm has reference to myForm, if not - you can invoke not OkButonIsClicked(), but OkButtonIsClicked(textBox1.Text, textBox2.Text, etc); ____________________________________________ Robin Panther http://www.robinland.com

    C# question

  • Drawing form without titlebar
    R Robin Panther

    To show form without title you have to set ControlBox property to false and Text property to "" Hope it help. ____________________________________________ Robin Panther http://www.robinland.com

    C# question graphics

  • How to get all IMG Tags from local HTML File to edit src properties?
    R Robin Panther

    I recommend you to take a closer look at Regex class ____________________________________________ Robin Panther http://www.robinland.com

    C# html tutorial question

  • C# key/mouse detection
    R Robin Panther

    take a look at this function: SendMessage and examine related functions - PostMessage, SendNotifyMessage etc. ____________________________________________ Robin Panther http://www.robinland.com

    C# csharp game-dev json

  • C# key/mouse detection
    R Robin Panther

    check this out. Hope it helps. Robin Panther http://www.robinland.com

    C# csharp game-dev json

  • change of size of PictureBox? (error in code, or in .NET2.0?)
    R Robin Panther

    try changing pictureBox1.SizeMode property to AutoSize. While you use SizeMode=Normal, pictureBox always keeps it's starting size, unless you tell it to change it. AutoSize mode will resize pictureBox to fully show image, each time image changes. Robin Panther http://www.robinland.com

    C# csharp help winforms com graphics

  • Waiting for a Process to end without freezing the starting app
    R Robin Panther

    You can handle Process.Exited event. like this: Process notepadProcess; private void button1_Click(object sender, EventArgs e) { notepadProcess = new Process(); notepadProcess.EnableRaisingEvents = true; // tell process to raise Exited event notepadProcess.Exited += new EventHandler(notepadProcess_Exited); // Exited event handler notepadProcess.StartInfo.FileName = "notepad.exe"; notepadProcess.Start(); } void notepadProcess_Exited(object sender, EventArgs e) { MessageBox.Show("Notepad process just has been exited."); notepadProcess.Dispose(); } Robin Panther http://www.robinland.com

    C#

  • waiting but still recieving messages....is there a way?
    R Robin Panther

    If I've understood you correctly, then I suggest you something like this: remember when timer was started in absolute values. use another thread loop with Join(interval) method, where interval = precision of time measurements, that you need. You can use timer component in the form to implement this simply. On each timer tick - check, is it second already. onClick event must first remember what time is now, in absolute values, stop timer, then calculate difference between start and stop time. Should work. Robin Panther

    C# help question csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups