Jump to content
Xtreme .Net Talk

Cags

Avatar/Signature
  • Posts

    699
  • Joined

  • Last visited

Everything posted by Cags

  1. Actually it can draw a combobox, its just called DrawComboButton(). As for a Textbox its just a white box with a 3d edge, hardly the most taxing thing ever to knock up. If you really can't be bothered with that, just take a screen shot, crop it with paint and add picture boxes with the controls images in.
  2. If you simply want to display a control but have no functionality you could draw it using the ControlPaint class. For example... System.Windows.Forms.ControlPaint.DrawCheckBox() You will need to pass it a Graphics object, but that isn't too complicated.
  3. Yes Insert does exist in VB. Dim index As Single = 0 Dim value As String = "test" Dim myArray As ArrayList myArray.Insert(index, value)
  4. If you wish to insert it at a specfic point you will need to use the myArray.Insert() method. However I'm not entirely sure what this would do if you called it and passed a number larger than the count. Assumably it would simply add it to the end at the latest avialable index.
  5. An ArrayList can store any objects, but is not strongly typed so it stores everything as an Object. If you wish to use one to store only items of a specific kind you can either create a strongly typed array or you can cast objects to access them. ArrayList myArray = new ArrayList(); int item = 10; myArray.Add(item); // to access the item item = (int)myArray[0];
  6. Assuming dialog is a form object that is declared globally (i.e. outside of a method) you can use the exact code you posted. EDIT:- Also the textbox value must be a public property in the dialog.
  7. I'm not entirely sure what you are trying todo. So I'll give you some examples of working with a MonthCalander. // this gets the selected date and outputs it to a ShortDate string, you can select many differnt formats also, such as ToLongDateString monthCalendar1.SelectionStart.ToShortDateString(); If you wished to add this date to a textbox you would do something along the lines of textBox1.Text = monthCalendar1.SelectionStart.ToShortDateString(); By adding this code to the DateChanged method of the MonthCalander you could then have the textbox updated whenever the MonthCalander is changed. If I didn't provide you with the answer you required, please let me know what it was you needed to know.
  8. I believe you can get between the two values by simply casting the objects. int myAsciiValue = 97; char myChar = (char)myAsciiValue; myChar = 'a'; myAsciiValue = (int)myChar;
  9. I have no idea how this can be triggering the same event regardless of where you click. But if you wish to use the interface properly whilst the search is going on, your best option would be to run the search on a seperate thread.
  10. I'm not sure about saving an image drawn using e.Graphics as I'm not sure how you could get hold of the object it is drawn to. There is a simpler solution, in the paint method just do somthing like this. Bitmap myBitmap = new Bitmap(800, 600); Graphics g = Graphics.FromImage(myBitmap); g.FillRectangle(mybrush, x * 16, y * 16, 16, 16); g.Dispose; this.Image = myBitmap;
  11. My bad, your right.
  12. It's worth noting that if the control is on your page at design time you can attach events using Visual Studio. Select the control, then in the Properties bar at the side click the small yellow lightning bolt to see a list of events. I had a quick look and it would appear the code you require is as follows. this.tabControl1.add_TabIndexChanged( new System.EventHandler(this.tabControl1_TabIndexChanged) ); private void tabControl1_TabIndexChanged (Object sender, System.EventArgs e) { }
  13. Using LastIndexOf to get the charCt should solve that problem. Or alternatively you could use the System.IO.Path.GetFileNameWithoutExtension() method.
  14. It's worth noting this Class isn't specific to .Net 2.0 and was included in .Net 1.1. I'd personally never heard of it, but I'll keep it in mind incase I ever have to do something like this. One thing I would say is that (certainly in 1.1) there appears to be no way to parse the information from a string. Whilst it will make comparing version numbers easier it seems to me like you will still have to manually parse the data read in. (Obviously this doesn't apply if your comparing with a server that can return an object).
  15. That would certainly work for a simple comparison. I was just assuming that the application would perhaps act differently depending on if it is a major or minor version change.
  16. 0.3.5 isn't a valid number as a number can only have one decimal place. A version number should be either treated as a string. Or treated as seperate Major and Minor numbers (plus any addition divisions required). So for your example of 0.3.5 you could store it as a string, then use Split to seperate it at the dots. You could then parse each individual part as a number to compare the version.
  17. The other topic that I linked to has a code sample attached to one of the posts near the end. It's a custom panel, but as I said before that's pretty irrelevant, the code included will show you how to create a rounded rectangle region.
  18. Yes it is possible, you could do it with GDI, but it would probably be easier to achieve by changing the region property of the form. You can see how to do that in the following post (which involved a panel, but the theory is the same). http://www.xtremedotnettalk.com/showthread.php?t=95162&highlight=rounded
  19. I could be wrong but it sounds like your searching for a simple solution. Unfortunately if this is the case you are probably out of luck as there are a lot of variables to consider. You will probably need to provide more information such as what you are trying to print for a complete answer.
  20. Yes MSN Messenger is very nice, it's also made by Microsoft, as is the .Net Framework. Contrary to popular belief they are pretty good programmers. Unfortunately, to the best of my knowledge they have provided no easy method to achieve this look. I'd have thought theres a reasonable chance that MSN doesn't use the Textbox control at all, but instead simply mimics the functionality. Even if it does I'd imagine that it's heavily modified in order to achieve this effect. I'm pretty sure you can run MSN Messenger without the .Net Framework, which furthermore means its written in unmanaged code which is far more powerfull, but can be alot more complicated to work with.
  21. Theres nothing your missing the simple answer is it's not possible. The complicated answer is you could probabably achieve the right effect by inheriting from the controls, but it will be very difficult to achieve the effect your after especially if you wanted it to be a generalised control that you could use anywhere. There are a number of simpler ways to fake it in a single application by overriding the paint methods of the controls, and passing the control a copy of the image to be drawn but its a pretty nasty method.
  22. Are all of the test PC's using the same version of windows, or are the PC's running a certain version of Windows not working correctly?
  23. You don't create a function that listens for that advent exactly. You just attach a method to that event. I guess they could be defined as the same thing. To attach an event in c# you would do... // this attaches a method to the event handler tabControl1.TabIndexChanged += new EventHandler(tabControl1_TabIndexChanged); // this is the method used by the event handler private void tabControl1_TabIndexChanged(object sender, EventArgs e) { // perform action here }
  24. I'm not sure I understand what you mean, it sounds to me like you want the TabIndexChanged event of a TabControl?
  25. A TabPage is a Container Control so when you are searching through Me.Controls it will only see the top level controls, i.e. your Tab control and anything else placed directly on the form. You need to recursively call that section of code for each Container object to search through thier Control collections. Check this post for a good example by marble_eater. http://www.xtremedotnettalk.com/showthread.php?t=96128
×
×
  • Create New...