|
Thanks Richard - not sure what your expectations are but I just dl'd a weeks reading in a few minutes from AAU
Rgds PhilD
Oh I also believe that the ControlCollection Find method on a form does not find toolstrip controls, but it does find controls imbedded in other things like TabPages- the searchallchildren argument is of course set to true.
|
|
|
|
|
I've never used a ToolBar object (I usually go through the hassle of making my own toolbars), but, after glancing at MSDN's documentation, it seems it would be pretty easy. The ToolBar has the ButtonClick event, and the ToolBarButtonClickEventArgs object tells you the index of the button clicked (with which to use switch). That seems to me like plenty of information to be able to act on clicking the different buttons.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Daniel,
The issue is not the processing of the click event on the button itself, but what events the control with focus experiences when the toolbar button is clicked. With form body buttons the control with focus can detect that it is losing focus etc - I can't recall the exact sequence but it's something like Leave, Validating, Validated, LostFocus - however with toolbar buttons the control with focus seems to experience no events whatsoever, when such a button is clicked.
Rgds PhilD
|
|
|
|
|
Hi..
can anyone help me figure out the algorithm for the following problem:
Consider a = {a , a , a ,...., a } //random values within set a
----------i----0--1---2-----n //these are the sub values
also
b = {b , b , b ,...., b } //random values's within set b
-i----0---1---2------n //these are the sub values
And
S = a + b
-i----i----i //these are the sub values
Find an algorithm O(n), that can return the n largest number(s) using c#..
Thanx soo much in advance..
Elie
|
|
|
|
|
Eliee wrote: Find an algorithm O(n), that can return the n largest number(s) using c#..
Get all Si results, sort array (ascending) and get your n results at the end of array.
Best regards, Alexey.
|
|
|
|
|
This is a school assignment if I ever saw one.
|
|
|
|
|
Yes, it's very simple solution, but this solution is "fast-realizable".
If you find O(n) solution please tell me. I'm so intrested...
Best regards, Alexey.
|
|
|
|
|
Isn't Radix sort O(n)?
Looking at what's given I half suspect the data has restrictions that would make a trivial solution possible, but I don't want to do this guy's homework for him.
|
|
|
|
|
Hey man, thanx 4 ur reply.. i wanted 2 ask you though, what u meant was consider a and b as arrays of values, then add them to a new array S containg the values of a and b, and then sorting the array, and then fetching the largest n #'s? But bro, isn't that more costy than O(n)?!?
Waiting 4 ur reply mate..
Thanx Again,
Elie
|
|
|
|
|
Is it possible to implement chat rooms that can use by the asp.net and the window form. Can this chat room use xml web services to connect each other? or got any suggestioon? Thank you thank you
|
|
|
|
|
Well... I have a Control Inherited from Combobox. The purpose is fill the items in the combo with the content of a Table... the problem is when I am filling the combo, even when it is not Visible, he Drops down at the load of the form... if there's only one combo, no problem... but when there are many combos, the load of the form results in an horrible intermitance while filling combo's, someone have any idea???
Ah... when i reassign the SelectedIndex or SelectedItem properties, the combo also Dropps down...
Bye
|
|
|
|
|
I'm trying to make my own screen-capture program. My theory is to take bitmap screenshots as fast as possible, and feed them into an AVI. I've read some articles on taking screenshots, and it looks like it's a tossup between using .Net (with Graphics.CopyFromScreen()) and using API calls (gdi32.dll and user32.dll).
I just finished the former, and it's slow. I can't get it to take bitmaps faster than about three per second (my goal is at most 30 per second).
My question is this:
Before I spend time on altering all my code, will using API calls make it take screenshots any faster? If not, I won't waste my time.
-Daniel
Typing too fast fro my owngood
-- modified at 19:55 Wednesday 24th May, 2006
|
|
|
|
|
Three per second sounds very slow, I'd expect the API to do it faster than that.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Alrighty, I'll give it a try. Thanks!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
It did go a little faster using the API calls (judging by informal indications, somewhere slightly more than 30 per second). Thanks! This site rocks!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I am looking for sample code that will allow the reading and writing of bytes to a .wav file. Thanks.
alias bear
|
|
|
|
|
Why don't you use the search function?
There are plenty of articles here!
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
using System;
using System.Runtime.InteropServices;
using System.IO;
public class Audio
{
[DllImport("winmm.dll")]
public static extern int PlaySound(String lpszName, int hModule, int dwFlags);
public static void Main(String[] args)
{
string filename = Directory.GetCurrentDirectory() +"\\" + "clock.wav";
PlaySound(filename, 0, 0);
}
}
|
|
|
|
|
I'm logging data to a listbox at a fairly rapid rate (10-100x /sec). THe problem is that after a few minutes my apps memory usage resembles a sawtooth wave with lows of 20-40megs and peaks of several hundred megs, each peak is typically larger than the preceding one until they get to about 250megs at which point the peaks size levels off. From saving out the logdata to a textfile, it's ~0.1% of the size of the memory usage peaks. My suspicion of what's happening is that each time I add an element to the listbox the entire Items list is destroyed and recreated. This would give the growth of several megs/second with periodic garbage collects being the large drops.
If I comment out the add line, my memory usage stays in the low double digit megabytes, so I'm fairly certain it's the listbox that's too blame. Is there anyway to do the updates without abusing the GC this badly, or do I need to rethink my logging and display approach?
lb.TopIndex = lb.Items.Add(timestamp + eventText);
|
|
|
|
|
Hi!
I think you seriously should reconsider your logging.
No use having several thousand entries in a ListBox - no-one will read them all.
Perhaps you could log to a file and just keep the last n entries in the listbox...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Is it possible to parse an existing string (CSS properties) with RegEx? For example, the background tag contains "#CA090D url(searchbg.gif) repeat-x bottom left". The first property is the background color and the second property is the background image. I would like to be able to pull all of the values into a collection and be able to extract and replace cetain values such as background color, etc. What might be a possible way with RegEx to extract and replace these values?
|
|
|
|
|
Yes it is possible to look for the background string with regular expressions, this is exactly what they are designed for. The problems would be with different permutations of the background tag. I can't remember exactly without looking it up but I seem to remember that the attributes aren't specified in any particular order. If they can be in a particular order then it is simpler. But a Regex like the following may work (with expansion):
background\:\w+(#[0-9A-F]{6})\w+url\(([^\)]+)\)\w+(\W+)\w+(\W+)
I'm not sure if this is 100% correct as I'm rebuilding my dev machine at the moment but basically it'll match a background colour (beginning with the background: tag, followed by a # and followed by 6 hex digits), some whitespace, url( any character except a ')') , whitespace, not whitespace, whitespace, not whitespace).
Each of the attributes is assigned a group which can be accessed through the Match object.
As for replacing the values this can be done with the Regex.Replace method.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I'm trying to do something very similar to this article here:
http://www.codeproject.com/cs/combobox/nishfontcombo.asp[^]
My question is that if you look at the font combo box in Microsoft Word it has the name of the font written in that font (just like Nish's combo box does and the one I'm working on) except where the font is a symbol font (e.g. Marlett, WingDings, etc). When there is a symbol font it prints the name in a regular font (looks like Arial) and then includes a few symbols after the name. This is something like a hybrid of the two different modes in Nish's example. Is there a way from the FontFamily object (or somewhere else) to tell that a font is a symbol font and not a regular font as Word seems to be able to do?
|
|
|
|
|
|
hi all,
i display some data from msaccess in datagridview according to some specific search criteria.
and i put 3 buttons (Word, Excel, Print) under that datagridview.
with 1st button, i want to save data displayed in a doc file. with 2nd in a xls file and the last one send to a printer.
how can i do this ?
anyone gives some information how to achieve what i wanna do ?
or suggests a document to read ?
thanks in advance,
bye.
|
|
|
|