|
< this contains the original Lounge post and content of material I deliberately left out of the Lounge post : feeling it was more appropriate here >
Hi,
I'm delighted to see that Jeff Anderson his taken latest version of AlphaForm[^], which was being sold as shareware, and now made it available to us, under the Code Project license, free !
I've created a "stress test" example of using Jeff's code that will move quite smoothly with virtually zero flicker, at run-time on an older system with no graphics card (i.e., using motherboard/CPU integration of all rendering) : PIV single core, 2.93 mhz, XP Pro SP 3, VS Studio 2010 beta, FrameWork 4.0, which I consider excellent since the load on the CPU for calculating the non-rectangular clipping regions must be high.
This example uses a .png bitmap saved in PhotoShop CS 4 as 24-bit .png with transparency, size 800x600, which includes one main content area, and two other content areas which are disconnected from the main content area (i.e., the form has non-overlapping areas of transparency : contains "holes") : inside this form there are two torodial areas cut-out from the main content area through which the underlying WinForm can be shown, and on which controls to be used at runtime can be placed. The source graphics (the complete images, source and the image mask files) I have optimized down to under 500k total using very valuable hints and tips found here[^]. I suspect further optimization is possible (particularly on the mask image, and I am experimenting with that trying to find the optimum level of reduction possible).
You can see the source image I'm using here[^], and the clipping mask image here[^].
These images are based on an excerpt from an image[^] in the public domain shown on Wikipedia, they are not original. The image is from a detail of a bronze frieze dating back probably a least 2000-2200 years ago, at Sarnath in India, showing the teacher born as Siddhartha of the Sakyas, and later known as Gautama the Buddha, giving what has become known as the "turning of the wheel" teaching that is believed, by Buddhists, to have "set in motion" (in a non-singular way [from the Theravadan Buddhist point of view]) the insights and practices that have led to what we now know as Buddhism. I was in Sarnath in October of 1975, and had a wonderful time there, even saw a live deer in the park !
If I reach the point where I feel I have enough mastery of Jeff's code that I can modify a few things, and have something substantial to say about using that modified version, or feel I have something useful to add about how to optimize use of it (or its source graphics files), I'll do a brief write-up, and post a link to it here (the WinForms forum) : hope you might do likewise if you use it and modify it.
So, thanks Jeff !
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
modified on Sunday, July 19, 2009 9:17 PM
|
|
|
|
|
I have a user control that contains a textbox control. I am getting some data from serial port. Anytime i get this data I need to raise keypress event of the user control that should internally riase keypress event of text box. I am a newbie to winforms and will very much appreciate if someone can walk me through steps on how to do this.
|
|
|
|
|
Hi,
two comments:
1.
are you sure you want KeyPress events? if all you want is append some text to a TextBox, why not use the TextBox.AppendText() method?
2.
if you use SerialPort.DataReceived event, you must be aware that event does not fire on the main/GUI thread; hence you cannot directly touch GUI Controls, you will need Control.InvokeRequired and Control.Invoke. If those are unfamiliar, search for InvokeRequired.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for your response. My real problem is much more complicated so I am just used a simple example. All I basically need is to know how can I programatically raise keypress event of a text box that is contained within a user control. Any code example will be highly appreciated
|
|
|
|
|
Any ideas about this guys? I really need it very urgently.
TIA
|
|
|
|
|
Hi everyone,
I am new to code project , sorry if i place the question in wrong area. I am struck by a problem while using threads. In my windows project I have MDI form and shows different forms in the MDI form.In one form i am sending mails. i am sending the mails in a separate process using threads to enable the user to do anything in the application while sending the mails.one progress bar will appear in the mdi form status strip, when mail is sending.
When user clicks the Send button in the form i make it disable until the mail is sent.Before calling thread i make it disable and after completion of thread's work i make it enable, it works fine. but my problem is, When user opens this form and send mails, if he visits another form and again comes to this form i am checking in the form load whether thread is going on, by check whether progress bar is visible in the mdi form , if it is visible i make the send button disable. I need the send button enable after thread completion, i make it. but it is not working. the send button is still disabled.I don't know why it is happening. if user remains in the same form it is working fine. if he visits another form it is not working. I am using thread invoke method for using the controls. but still the problem is there.
Please any one help me
Thanks in advance.
Rajesh.
|
|
|
|
|
Hi,
threads can't access Controls directly, only the main thread can. You need one of two things:
1. use the Control.InvokeRequired/Control.Invoke pattern (search for InvokeRequired in CP articles)
2. or use a BackgroundWorker instead of a Thread; that one has InvokeRequired built-in into its ReportProgress and WorkCompleted events.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for reply,
I am using Invoke method, still problem arises. Actually while i start a thread from the form i am able to enable the button but once if i visit another form and again returns to the this form while the thread is running the button is not enabled in the thread. why iam not able to do it. i think u understand ny question .please let me know. waiting for ur reply.
Regards,
Rajesh.
|
|
|
|
|
sekhar.k wrote: i think u understand ny question
apparently not. you did something wrong or didn't tell an essential part of the story.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
HI All,
I am working with WINPE1.6 to capture the Windows Server 2003 Image. But I am landing with the problem "fail to create XMLdoc, MSXML2::DOMDocument not found".
I have registered msxml2, msxml3, msxml3r, msxml6 and msxml6r in pe mode. But still same error we are getting.
Actullay we are booting the system im PE mode and trying to capture the image with winpe 1.6 (WINPE2.0 is not supporting for windows server 2003). But getting the above specified error.
Any Idea why this error is coming and please provide me the solution.
Thanks in Advance,
AR Reddy
|
|
|
|
|
I want to build a new windows distributed application (server/ Client). The client (.NET envoirnment)will be at a remote place outside the city (at any place) that shall be able to interact with the server for saving or retrieving data. On the server side the same application will be performing same tasks as the client side on LAN. There will be layers such as GUI,DAL,BLL(Bussiness logic), Controller and Data Types
1. Is it possible to have a same windows application at both sides (client and server )as i am presuming it to be?
2. What mechanism will be used for transporting data between the server and client
will it be a static IP address and http or something else i dont know?
3. Windows remorting or Web services will be useful for that?
i hope it will not bother anybody to help me.New to dot net so wanted to share and recieve ideas thanks
Thank every helper
|
|
|
|
|
***************************
For the record this is a cross-post.
I dont want to get anyone mad it's
just that i really need help with this
Original Post[^]
***************************
Hey All,
I am experiencing a strange issue, i have built and tested my RegEx in Expresso but when I call it from my code (C#) I am not getting any matches. If i step through and grab the values from the variables and put those in Expresso it works ....
RegEx:
<br />
Lead\sID\sNumber:\s*(?<LeadNumber>[^\r\n]*)(?:\r\n)+<br />
Prospect\sName:.*(?:\r\n)+<br />
Prospect\sContact:.*(?:\r\n)+<br />
Prospect\sPhone:.*(?:\r\n)+<br />
Marketing\sCampaign:.*(?:\r\n)+<br />
Prospect\sInformation:\s*(?:\r\n)+<br />
===============\s(?:\r\n)+<br />
(?<Company>[^\r\n]*)(?:\r\n)+<br />
(?<Address1>[^,]*),\s(?<Address2>[^\r\n]*)(?:\r\n)+<br />
(?<City>[^,]*),\s(?<State>[^\r\n]*)(?:\r\n)+<br />
(?<Country>[^,]*),\s(?<Zip>[^\r\n]*)(?:\r\n)+<br />
Contact\sName:\s*(?<FirstName>[^\s]*)\s(?<LastName>[^\r\n]*)(?:\r\n)+<br />
Contact\sPhone:\s*(?<Phone>[^\r\n]*)(?:\r\n)+<br />
C#:
<br />
MatchCollection myMatches = Regex.Matches([Text], [RegEx], RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace | RegexOptions.CultureInvariant);<br />
[Text] = the body of an email
[RegEx] = the above pattern
Any input or ideas would be greatly appreciated.
|
|
|
|
|
Hi,
I would debug such beast using "binary search", i.e. throw away half of the search specification, and keep doing that until something matches. Then you know the problem is in the part you last removed.
OTOH I would never come up with such a complex Regex pattern in the first place. It is just unreadable. And what happens if someone somewhere decides to add/delete a space, a new line, whatever to the e-mail format?
IMO you need several smaller operations to extract the fields individually, your code looks like a maintenance nightmare to me.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hello Luc,
Normally i would agree with you 200%, however this is a subcontract project which is going to be used by other developers. They wanted me to allow for configuration of the email parsing by having a setting which contains the RegEx to use.
You can find the solution to my problem here[^], i didn't want to keep cross posting.
Thanks again for your input.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
That's interesting. Thanks.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Is it possible (and how) to make an user control with a panel and make it a container (so that I can drop other controls on it at design time?
Or if it is simpler
If i place a button on the usercontrol - what do i need to do so i can click it at design time?
What is the point in reading a book about the future when it is allready the past.
|
|
|
|
|
Yes it is possible. A thread here[^] has the same thing as you need.
modified on Wednesday, July 15, 2009 12:38 AM
|
|
|
|
|
Hi Feudalac,
In addition to the thread that d@nish just referred you to, Henry Minute was inspired by that thread to publish an article here on CP exactly addressing this problem.
Designing Nested Controls[^]
I participated in that thread, and also illustrated one way to do this for one single usercontrol containing one container object, and you could, in theory, combine any number of these one-container-per-usercontrol objects at design time, but Henry's solution went far beyond mine in terms of practicality : his solution will let you do the same with multiple containers on one usercontrol.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
Thanks all!
What is the point in reading a book about the future when it is allready the past.
|
|
|
|
|
Hello all,
My crystal report contain hyperlinks to the Event Video file (i.e..avi files).
Its format is somewhat like -
"EventVideos/EventVideo_" + {DataTable1.EventId} + ".avi"
As I create hyperlink at design time, it remains active for all the events. But the case is that my all events do not have Event Video associated with it. So, such events also have hyperlink for event video which is not expected.
To avoid this, I have to delete or disable the hyperlink for such events.
My question is - Is it possible to delete or disable the hyperlink at runtime in Crystal Report? If yes, can you please explain me how?
It will be great help. I will appreciate it.
Thanks in advance.
|
|
|
|
|
hello there,
i have been stucked with a problem in vs2008(vb.net)
I have two table one Employee and EmployeeDetail in MSSql server 2005
Employee
EmployeeID int autoincrement PK
Employeename varchar(50) not null
Employeedetail
EmployeeID int FK
EmployeeVisaNumber varchar NotNull
EmployeeAddr1 varchar(50) null
I created a datasource EmployeedataSource with add new datasource wizard
with this two tables
I then Drag this datasource to my form
First i changed the Employeedetail node in the employeenode to details view from datagrid view
and drag it into the form and then changed the view of the employee node to details and drag it again to the form
and when i run
only the master fields are getting updated to the database
or either the detail fields
I have to display the master and details in tabbed control
master in one tab
detail in another tab
and i need all functionalities(add,save,delete,update,navigation)
thanks,
suraj
|
|
|
|
|
In the DataSources Window, if you expand your Employee node you will see an EmployeeDetails node right at the bottom. It is this EmployeeDetails node that you should be using.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for your reply
But i did exactly as u told
Then also the same problem exists
|
|
|
|
|
Try working through this tutorial[^] as a new solution, so that you can get a better understanding of the process, then come back to your project and try again.
Please come back with more questions if you still have problems after doing that.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'm not sure I'm in the right group for this but I'm trying to develop a program or better yet get one that's a blackjack game simulator that over million hands etc and give me the wins or losses statistics of my systems over time. It's easy to get a blackjack simulator but not one that over million hands etc and give me the wins or losses statistics of my systems over time.
Thanks in advanced for any suggestions.
|
|
|
|
|