|
well if you want to set the region of the control you can do that in the load of the control
if you want to draw something on the control (using the graphics) you should be able to use
Protected Overloads Overrides Sub OnPaint(ByVal e As PaintEventArgs)
'you're code comes here
MyBase.OnPaint(e)
End Sub
or for a custom control
Private Sub ctrlLineHorizontal_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
End Sub
keep in mind that the code you place inside the paint methode/event will me run everytime you're control repaints and this happens when you
move the control (at run time) (or parent control/form)
when another window is placed on top of it and then you return to the control
when you resise the control (or parent control/form)
so it would be wise to keep the code inside the paint methode/event to an absolute minimum
|
|
|
|
|
how can i set the region of the control at load of the control
did u mean the load event of the control (the control does not have the load event)
second
Protected Overloads Overrides Sub OnPaint(ByVal e As PaintEventArgs)
'you're code comes here
MyBase.OnPaint(e)
End Sub
r u confirmed about the position of the ('you're code comes here) in the code
because in all examples i saw the position of ('you're code comes here) is
Protected Overloads Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'you're code comes here
End Sub
can u plz give me an example of that what i m trying to do
|
|
|
|
|
1: normally every usercontrol has a load event (doubleclick on the control should automaticly place you in the code of the event)(otherwise you can select the event in the 2 comboboxes just above the code(in code view) first comobox: (usercontrol1 events) second combobox: load)
2: I'm not sure but I don't think the placement of the mybase.onpaint(e) matters
example (kryptic)
public sub load event
me.region = new region... 'see previous posted code
end sub
Protected Overloads Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
e.graphics.drawline(...)
e.graphics.drawstring(...)
'...
End Sub
if you give me a more detaild description of what exactly it is that you want I could give you more detailed code
what needs to be drawn?
what shape is you're control?
when does the movement happen (all the time or when you tell it too)?
...
|
|
|
|
|
what i need to draw is a ruler control
which contain
1. a background.
2. some number on that control at specified distance like inches.
3. some vertical lines just like the normal scale has.
4. two slider's one is upper and the second one for lower usually as in the any application which is used to increase or decrease the page margin.
5. these slider's should be able to move horizontally or vertically on the ruler
i have tried it to write in class, customecontrol, usercontrol also
that some thing i worried about.
any suggestion is appreciated
thnx
help everyone
|
|
|
|
|
1. I'm asuming this is already done (me.backcolor=...)
2. (simple example)
Dim i As Integer = 0
For i = 0 To 10
e.Graphics.DrawString(i, New Font("arial", 8), Brushes.Black, i * 10, 5)
Next
3. (simple example)
Dim i As Integer = 0
For i = 0 To 10
e.Graphics.DrawLine(Pens.Black, i * 10 + 5, 0, i * 10 + 5, 10)
Next
4. create 2 new controls and give them the shape of an arrow with the region property
5. I'm boxing something together for this and get back to you
1 can be done in the load of you're control or in a property
2 and 3 are best done in the paint event
|
|
|
|
|
I've created a very simple example but it is to much code to post here
Can you provide me with an email so I can send it to you
You can mail me directly from this site (choose email instead of reply)
|
|
|
|
|
i think u already had my mail id
i sent a mail to you check it out.
again thnx
help everyone
|
|
|
|
|
thnx for the reply
but plz can u provide the same in English
the example u send that's in some other language and i m unable to understand it, so it will be greateful if u send me it in some simple english. hope u will help me. again thnx for reply
help everyone
|
|
|
|
|
Dear All,
My program has several memory problems. So I want to correct those. But, before start correcting the memory problem, I need to determine the kind of memory which is leaking. So please help me how can I determine what kind of memory leaking and where it is happening?
I am using VB.NET 2003 and MS Access 2003
any code to detect it and disply in output window or msgbox?
Thanks
Dimuthu
-- modified at 4:10 Wednesday 8th August, 2007
|
|
|
|
|
There are a few good commercial apps on the market that can help you. They arn't particually cheap but they are well worth the investment if you work professionally.
My fav is JetBrains dotTrace Profiler/[^]. It has a trial period if you want to use it for this one problem.
|
|
|
|
|
Thanks,
But the JetBrains dotTrace profiler is working only on dotnet framework 2 applications. I have dotnet framework 1.1.
|
|
|
|
|
Well, Access, there's yer problem
On a serious note, take a look at http://www.scitech.se/[^]
God knows how much it costs, I just get to use it. You'd be amazed at what hangs around in a windows app. Release those damn event handlers!
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
hello frnd,
i am using VB 6.0, i have a code to get the file system of my machine
means is it NTFS, FAT32 , BLAH... how can i get it???
please help,
thankx in advance
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
hi,
isnt it dependant on the OS
ie Xp can support NTFS,FAT and FAT32.
Each hard disk partition on an XP machine can be any one of the above
so you have to read the properties of the particition you want
I think theres an API for that but dont know it off the top of my head
HTH
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
I m developing typing tutor, and i need a keyboard in it.... i just need a keyboard that only inimates any keypress event? like when i type "a" on my physical keyboard, my vitual keyboard should animate "a" key down... any help in this plzzz?
(Jameel)
|
|
|
|
|
You could make a keyboard out of labels, and then when the user types capture the key down event and determine which key the user pressed to change the back color of the corresponding label.
|
|
|
|
|
i m developing a typing tutor, how can i keep track of different users, what they are upto (i.e. their progress). and 1 more thing i want user to have their own preferences(setting) for tutor, i want to save and retrieve back settings for every diffrent user.... any idea how can i implement it in VB.NET 2
(Jameel)
|
|
|
|
|
XML seems a good idea, it's probably not a ton of data to store. Otherwise, you could use access, or a real database like SQL Server Express
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how abt the idea if i make a class of user setting and then write/read an obj using serailization to a binay file?
(Jameel)
|
|
|
|
|
Sure, that works.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
is there any other way to capture key strokes from keyboard with out using any event handling? e.g test_control.keypress etc....
i want to capture all alphabatic keys in some loop bt i cant
(Jameel)
|
|
|
|
|
Can you please elaborate what exactly you are looking for?
Regards,
Nilesh
|
|
|
|
|
i want to know what key is pressed like
do
READ-FROM-KEYBOARD
msgbox("U pressed " " key")
-----
-----
loop while(mycounter)
now let me know what to write instead of "READ-FROM-KEYBOARD"???
mean equalant of "getchat(stdin)" in C, got now?
(Jameel)
|
|
|
|
|
AFAIK the only way to do this is with event processing. The keyboard is not an entity in VS. I wonder if you can get into the comms between the keyboard and the cpu. Seems a bit silly when there is the event to work with
|
|
|
|
|
Make a console app and use Console.ReadKey !
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|