Jump to content
Xtreme .Net Talk

TechnoTone

Avatar/Signature
  • Posts

    225
  • Joined

  • Last visited

Everything posted by TechnoTone

  1. I want to allow \r, \n, etc, to be entered into a textbox (windows form) but then when I query the textbox it interprets them as @"\r" and @"\n" and not the scape characters "\r" and @"\n", etc. How can get these escape characters without them being converted to literal strings?
  2. Don't know why I didn't search for "context menu handlers" before but I just did and found loads of information. Sorry! Can someone please delete or close this thread.
  3. Anyone know how to create a sub-menu on the Windows Explorer context menu? I'm trying to do something similar to the WinZip sub-menu's. After looking in the registry I found an entry in "HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\WinZip" which refers to a CLSID which then refers to the WinZip DLL WZSHLSTB.DLL which is a shell extension context menu handler. What I need to know is what does this DLL do and how does it work. I'm guessing that there is a common interface that a shell-extension context-menu handler has to implement for it to function within Windows Explorer but I don't know what it is or how to find out. I've even tried looking into the WZSHLSTB.DLL (and the accompanying WZSHLEX1.DLL) with a HEX viewer but that didn't help. I can see lots of function names but I don't know what the parameters or return values are. Does anyone have any information on this or any suggestions on how I can find out?
  4. I realise that, but what I'm worried about is having to re-work the rest of my project into C# just because I need C# for one particular object. I was hoping I could incorporate a C# class into the existing project without having to re-do all of it. To clarify, the project is a common library that we use within our projects which encapsulates commonly used objects and functions. We are reluctant to split it into more than one library so it looks like we will have to convert all of it to C#.
  5. Thanks. I am an experienced VB.NET developer (been using VB since version 4) but have been considering learning C# too. It seems now is as good a time as any to get started. By the way - is it possible to mix C# and VB within a single project/assembly?
  6. Cheers people. Looks like it's finally time I got stuck into C#.
  7. I want to create my own object type called SWIFTBIC. This object will essentially be a String but it will have built in validation to ensure that the assigned value can only be a valid SWIFTBIC. Valid SWIFTBIC's are 6 characters followed by either 2 or 5 alphanumerics (Regular Expression "[A-Z]{6}([A-Z0-9]{5}|[A-Z0-9]{2})"). This in itself is fairly straight forward. However, my problem comes from the way I want to be able to use my SWIFTBIC. I want it to behave in the same way a String variable does, so that reading and writing to the objects value can be done directly as follows: Dim mySB as SWIFTBIC mySB = "ABCDEFGH" myTextBox.Text = mySB I realise that the direct assignment may not be possible without using a constructor: mySB = new SWIFTBIC("ABCDEFGH")That I can live with, but how can I get access to the objects value directly without having to specify a property? I've tried using default properties but that won't work without a parameter. I've also tried inheriting a String but that isn't allowed either. Is there any way to do what I want (using VB.NET preferably)?
  8. Ah yes - I missed the "and clickable" bit. Sorry. Yes - a separate thread would be the way to go in my opinion.
  9. Try either Me.Refresh or Application.DoEvents.
  10. I too use Microsoft's Visual SourceSafe. It works well enough for me.
  11. Nice. I wouldn't have thought of that.
  12. I come somewhere between 2 and 3. I try to plan as much as possible but I usually find gaps in my plan once I start work on development.
  13. That's not quite what I meant. In your example I agree, delegates provide a much better solution to using a timer. Interrupt or Event driven processes are always better than Polling processes as there is no wasted effort. What I'm asking is why would you go through the effort of using delegates directly when AddHandler and RemoveHandler do all the hard work for you? I think I've discovered one reason. AddHandler and RemoveHandler are VB.NET only so you can use them if your just interested in VB.NET programming but if you want to use C# or are considering using C# then you should get used to using delegates directly.
  14. What is the difference between using Delegates or using AddHandler and RemoveHandler? Are AddHandler and RemoveHandler actually using delegates behind the scenes anyway? If so, why would you use deletages manually?
  15. Turn on the forms KeyPreview property and respond to its KeyPressed event. When a function key is pressed you can show the correct panel (and hide the others).
  16. In that case you'd need some way of identifying which ones your interested in. You could use their name, if they were all named similarly. For example: If control.Name.StartsWith("txtTheseOnes") then control.Hide Or you could use the Tag property to distinguish them.
  17. Excellent. Got it working. Thanks. Here's my final code, in case anyone's interested: myTimeRangeBitmap = New Bitmap(picTimeRange.ClientSize.Width, picTimeRange.ClientSize.Height) Dim ForeBrush As New System.Drawing.SolidBrush(SystemColors.Highlight) Dim BackBrush As New System.Drawing.SolidBrush(SystemColors.Control) Dim x As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(myTimeRangeBitmap) Dim StartPos As Integer = (trackStart.Value * picTimeRange.ClientSize.Width) \ trackStart.Maximum Dim StopPos As Integer = (trackStop.Value * picTimeRange.ClientSize.Width) \ trackStop.Maximum If StartPos < StopPos Then x.FillRectangle(BackBrush, 0, 0, StartPos, picTimeRange.ClientSize.Height) x.FillRectangle(BackBrush, StopPos, 0, picTimeRange.ClientSize.Width - StopPos, picTimeRange.ClientSize.Height) x.FillRectangle(ForeBrush, StartPos, 0, StopPos - StartPos, picTimeRange.ClientSize.Height) ElseIf StartPos > StopPos Then x.FillRectangle(BackBrush, StopPos, 0, StartPos - StopPos, picTimeRange.ClientSize.Height) x.FillRectangle(ForeBrush, 0, 0, StopPos, picTimeRange.ClientSize.Height) x.FillRectangle(ForeBrush, StartPos, 0, picTimeRange.ClientSize.Width - StartPos, picTimeRange.ClientSize.Height) Else x.FillRectangle(BackBrush, 0, 0, picTimeRange.ClientSize.Width, picTimeRange.ClientSize.Height) End If picTimeRange.Image = myTimeRangeBitmap
  18. I haven't had very much experience with graphics so please bear with me. Here's what I'm trying to do. I have two TrackBar controls, trackStart and trackStop. These represent Start time and Stop time. They are horizontal TrackBar's, one directly above the other. Between these two controls I want to draw a coloured bar indicating the running time (time between the Start and Stop times). How should I do this? I thought that I should place a PictureBox between the TrackBars which displays a Bitmap object. I'm confident that I can figure out the coordinates that I need to get the results I want but I'm having difficulty working out how to paint onto the Bitmap object and then display it. Any pointers?
  19. That will work but it isn't very efficient as for each seatno in Table1 it returns all seatno's from Table2. A better way would be: SELECT * FROM Table1 WHERE NOT EXISTS(SELECT TOP 1 seatno FROM Table2 WHERE Table2.seatno = Table1.seatno) In addition, what about all records from Table2 with a seatno that isn't in Table1? Are there any? If there are then these will have to be retrieved too - perhaps a UNION query?
  20. TechnoTone flees before he gets found out by Derek Stone too. ;)
  21. Additionally, if the property influences other properties or modifies the look or behaviour of the control then you can put the code to manage this within the property set which is something you would not be able to do with a public variable.
  22. The answer must be determined by your reasons for moving away from .NET and the functionality of the project.
  23. I have some code that changes my internet connection settings (sets a proxy server, etc). However, it seems that when you do this from Internet Explorer something happens (I'm guessing it's a windows message) that causes any open IE windows to refresh their connection details as they will now use the new details. When my program changes the connection settings any open windows keep their old settings and so I have to close them before the new settings take effect (or open the Connection properties (Lan Settings) and click OK). Is it possible to get my program to do the same thing?
×
×
  • Create New...