|
There seem to be two kinds of drawing methods in ControlPaint:
- the ones working on the screen, using screen coordinates, ignoring all windows, just
painting everywhere;
- the ones needing a Graphics; now a Graphics always has clipping built-in, that's one of
its features (did you ever care about a DrawString exceeding the width of a Control?).
As another reply already told you, you (theoretically) cannot make a Control's OnPaint
paint outside the Control, i.e. you must set the Control's Size large enough so it contains
all the areas where you want it to paint something (that's how non-rectangular Forms
basically work, as far as I can tell from reading some articles, I am not really in to this).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
Hello
I develop an aplication where i need to use the crystalreport for displaying the data.
The data i want to display in the crystal report is on the data set, this data set is created and filled in runtime.
How i can tell the crystal report to take the data from this dataset
Any hint or example wil gratly appreciated
Thanks in advance
Assaf
Assaf
|
|
|
|
|
This code will help you:
CrystalReport.DataSource = Dataset.Tables("TableName")
and you are done !
Hope it helps !
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
hi dears,
how can i make a switch with serial ports, that mean when i connect two pins (for example pin 2 with pin 3) , program run a code
|
|
|
|
|
Ok,
If i understand you correctly on this, you're trying to switch something, say a LED or a device using the PC serial port. Nice plan but unfortunately the serial port doesn’t work like that!
The serial port is a communications device and simply used to send ASCII data to and from the PC via some software. The good thing is there is plenty of help on the serial port to help you achieve this. Microsoft have thankfully included a class from the serial port in VS 2005 see http://msdn2.microsoft.com/en-us/library/system.io.ports.serialport.aspx[^]
Now the serial port, well in a very simple cut down way is capable of doing anything you want, however you will need to implement additional electronics to achieve this.
When data is sent to the serial port, depending how its configured by baud rate etc, the signal is in a eight bit stream hence its name, this simply means any data sent to the port would look like a train of 1's and 0's. If you send the character 'A' the code would simply translate this to the ASCII value '65' which is '1000001' is binary
This is simpler to understand if you write a comms application between two computers.
The electronics would have to be a microcontroller of some description, PIC16F84 is good for beginners. The serial port could be coupled together with a MAX232 IC inteface directly and connected to the PIC16F84. This would be a very simple circult and probably thousands of web links to it. The Microcontroller can be programmed to respond to anything to demand, turn on a led or a relay etc.
http://www.boondog.com/tutorials/pic16F84/pic16f84.html[^]
Have Fun!
|
|
|
|
|
Hi,
a serial port has two data lines (one input, one output) that carry the data bits in a
serial fashion; it also has some control lines, some of them are inputs, other outputs.
Look for names such as DTR, DCD, RING, RTS, ...
1. If what you need is the app controlling some output:
Once you opened the serial port, you can control the state of those control pins that are outputs.
Warning: the voltages on those pins COULD be anywhere between plus and minus 15V with
respect to the ground pin (GND); and should switch at least between plus and minus 5V.
Also the load you are allowed to connect is limited (don't know the numbers by heart).
So you could connect an LED (with appropriate series resistor, to limit current to
say 15 milliamps) between a control output and GND, and turn it on/off by setting the
corresponding property. If you need to control a higher current you will need either
a relay or some electronics.
2. If what you need is the app responding to some input:
once you opened the serial port, your app can observe (or get PinChanged events) from any of
those control pins that are inputs.
Warning: the voltages you apply to those input pins MUST be between plus and minus
15V (with respect to GND) in order to not damage the hardware, and outside minus and plus
3V to be unambiguous.
For more info on serial ports, there are a couple of articles on CP, such as this one.[^]
-- modified at 20:57 Saturday 10th November, 2007
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Can someone help me on how can I make a program in visual basic 6 that manipulates the disk quota of a particular drive? or perhaps, get the total size of a subdirectory?
|
|
|
|
|
Hello all!
If an object has a member, who's name was not known but only stored in a string, how could I access that member?
Thanks in advance,
Fahad Sadah
New freeware site underway!
|
|
|
|
|
What you exactly mean by this question??? How come an object has a member who has no name ! and if it is then what you think intelliSense is for? and didn't understand yet what you exactly trying to ask.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: How come an object has a member who has no name !
He didn't say the object's member had no name. He said the name was stored in a string.
|
|
|
|
|
Thanks for correcting me man ! but can you please explain it a bit "object has a member, who's name was not known but only stored in a string" I still don't get it.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
I'll give an example:
<br />
Dim obj As New MyClass<br />
Dim str As String = "member"<br />
Assume that str was user input, and I do not know what it is. How do I access obj.str?
|
|
|
|
|
Are you saying that user knew the method in your Class and you want to choose the method in your MyClass according to what user enters ???
Fahad Sadah wrote: How do I access obj.str?
str is not even a member of MyClass its just a string field which can be used at class level or in a method locally depends on its declaration.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: Are you saying that user knew the method in your Class and you want to choose the method in your MyClass according to what user enters ???
Or maybe the user knows something from which a lookup in a database or XML file could be made which returns the name of the method.
AliAmjad wrote: str is not even a member of MyClass
True, you cannot use a string in that way. But you can use the string to invoke the correct method through "Reflection"
|
|
|
|
|
I know buddy but as he said in his later post bellow that he's a newbie didn't know anything about reflection so thought that he didn't ask a question related to reflection !
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: I know buddy but as he said in his later post bellow that he's a newbie didn't know anything about reflection so thought that he didn't ask a question related to reflection !
Why would you think that? The most obvious thing is that if he didn't know anything about reflection then his question may be related but he didn't realise it was related. It is therefore necessary to bring the idea to his attention to find out if it really is related or not.
|
|
|
|
|
Ok Thank you very much for bringing this aspect to my attention. It was quite a nice learning experience for me. Thanks !
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
sounds like your talking about reflection...
|
|
|
|
|
Pardon the noobish question please: whats reflection?
|
|
|
|
|
Fahad Sadah wrote: whats reflection?
There is a System.Reflection namespace that contains a number of useful classes to help you with this.
Everything has a GetType() method which returns a Type object.
Use GetMethod() to find the method that you want with the string. This will return a MethodInfo object.
You can then use the MethodInfo object with your object to Invoke() the method.
|
|
|
|
|
Hello,
I'd like to know how i can record the screen, and save it as a .wmv or .avi. Anyone got any idea's?
--Zaegra--
|
|
|
|
|
Zaegra wrote: I'd like to know how i can record the screen, and save it as a .wmv or .avi. Anyone got any idea's?
Camtasia Studio[^] from Techsmith[^] is excellent. I use it from time to time for building training materials.
|
|
|
|
|
I am novice to VB 2005.
I have one DataTable Dtbl. May I sort it?
Following is not good for my case:
foundrows=dtbl.select(expression, sortorder)
above command returned sorted rows from Datatable, I need table to be sorted.
Have good comments
Nasir Mahmood
|
|
|
|
|
Sort the data in your database query that you use to populate your DataTable.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|