|
Write a program that allows the user to draw a "free hand" image using a mouse in a picture box.
Hlalele
|
|
|
|
|
Is this a demand?
Or a challenge?
Have you even started writing this application?
Is there a specific bit of code you're stuck on?
Which version of .Net are you using?
|
|
|
|
|
you have to create a class for that free hand object.
then you have to pass the mouse points through the following events
PictureBox1_MouseDown
PictureBox1_MouseMove
PictureBox1_MouseUp
then use the graphics.line or graphics.arc etc.
i will help you if you are really interested in it.
Sathesh Pandian
|
|
|
|
|
hi,
I have a table "unix", it has 2 columns "LastAccessedBy" & "LastAccessedDate" in the Apps/ASPNETDB.MDF
is there any code syntax that: when a user log in, automatically the username & login time should get insert into the above table 2 columns (something like Sub Page load..syntax..)
Thanks in Advance.
|
|
|
|
|
wrote: is there any code syntax that: when a user log in, automatically the username & login time should get insert
Logged in to where?
If this is your application, then your application can issue an INSERT command to the database to add the information.
|
|
|
|
|
Set defaults on the table DDL to suser_sname() and getdate() respectively..
e.g.
CREATE TABLE unix
(
-- other fields here
LastAccessedBy varchar(220) not null CONSTRAINT [DF_LastAccesedBy]
DEFAULT (suser_sname()),
LastAccessedDate DateTime not null CONSTRAINT [DF_LastAccesedDate]
DEFAULT (GetDate())
)
Then if you don't explicitly pass a value to those fields they will be defaulted to the user id and time
|
|
|
|
|
thanks jones,
date is really working fine, but for user --.
the story is: I have a gridview in aspx page, when the user click on edit, he could able to modify only 1 among 3 fields "Description" & rest of the 2 fields should be automatically updated with the username & date. now date is successfully updating, but user it takes as "dbo" which in not true.
in simple words what I exactly need is: to add current logged in user info to be inserted in the table-Unix various columns, (basically for the audit purpose)
thanx jones.
|
|
|
|
|
I am working with all vb.net classes for coding Components and controls, but frankly speaking never used Interface in my any of the Projects ,as it never really strike across my coding, But I really want to know why exactly its required in my class. How to get it.
Develop2Program & Program2Develop
|
|
|
|
|
Interfaces are a definition of a behaviour that many classes may impliment. For example, IEnumerable is the interface used to enumerate over an object. Any class can impliment it, and any object can be tested to see if it impliments it. If it does, it can be cast to this interface type, and it will then expose only the methods common to this interface.
It is, in part, a way of getting around the lack of multiple inheritance.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Ok Chris , I got a little of it since i can Inherits only single class, so to make use of other class or inherit other class method/Properties along with the Inherited one I need to use Interface,it would be pleasure if you can emphasise one basic example so that I can pick from it and proceed to build on my knowledge on Interface from reference material.
Thanks
Navneet Hegde
Develop2Program & Program2Develop
|
|
|
|
|
Here's an example for you. Imagine the following 2 classes:
<br />
public class Switch<br />
<br />
public myLight as Light<br />
<br />
public Sub New(aLight as Light)<br />
myLight = aLight<br />
End Sub<br />
<br />
public Sub SwitchOn()<br />
myLight.TurnOn()<br />
end Sub<br />
End Class<br />
and
<br />
Public Class Light<br />
private isOn as boolean<br />
<br />
public Sub New()<br />
End Sub<br />
<br />
Public Sub TurnOn()<br />
isOn = true<br />
' And some other code to shine brightly<br />
End Sub<br />
<br />
End Class<br />
The Switch class contains an object called Light, and a method to turn the Light on. The classes work perfectly, they do what they should do.
But they are too coupled with eachother.
What if, you want to use the Switch class to turn on a Bell? Creating the bell class...
<br />
Public Class Bell<br />
private isOn as boolean<br />
<br />
public Sub New()<br />
End Sub<br />
<br />
Public Sub TurnOn()<br />
isOn = true<br />
' And some other code to ring loudly<br />
End Sub<br />
<br />
End Class<br />
is not a problem. But now integrating the new Bell class with the Switch class is going to be a pain.
Enter Interfaces.
Create the following Interface
Public Interface ISwitchableObject<br />
Sub TurnOn()<br />
End Interface
Now your Light and Bell classes can inherit the interface, modify the following lines in each class:
public class Light Inherits ISwitchableObject
and
public class Bell inherits ISwitchableObject
Finally, modify your switch class to the following:
<br />
public class Switch<br />
<br />
public myObj as ISwitchableObject<br />
<br />
public Sub New(anObject as ISwitchableObject)<br />
myObj = anObject<br />
End Sub<br />
<br />
public Sub SwitchOn()<br />
myLight.TurnOn()<br />
end Sub<br />
End Class<br />
There, now no matter whether you pass a Bell or Light to the Switch object, it will still handle it exactly the same way. Your classes are now decoupled
And dont forget, we should all be programming to interfaces, not programming to implementation!
Mark
|
|
|
|
|
Thank you very much.
Develop2Program & Program2Develop
|
|
|
|
|
Hey all,
anyone know if there's a quick easy way to autosize the width of the dropdown box, based on the items it lists?
Or is there a way of finding the width of a string in pixels, so I could set the dropdown width with that value?
Any ideas for a Monday morning?
Mark
-- modified at 5:33 Monday 19th February, 2007
|
|
|
|
|
|
That would be great if I was using VB6!
I was hoping there was something abit simpler and more "managed" in .Net 2
|
|
|
|
|
I dont have the code right now but here is the suggestion for Googling. You cannot look at the length of the string itself you must look at the total character length of the values and keep the widest value and set that width value to the width of the combobox but add a little extra to include the width of the drop down arrow.
Cleako
|
|
|
|
|
Hi all
I need to write into word document through VB.NET. The data is supposed to come from the textbox created by me using the com addins. The text box is appears in the command bar area. The code will pick the data from textbox & put in the new word document.
i am able to write the data in the new document but not in the same document
Can anyone of you tell me how to write the content of textboxe in word document.
Thanks in Advance
Prashant Malik
|
|
|
|
|
plz give me ans that how to insert binary data into database by using vb.net?
|
|
|
|
|
Have some patience! It has been only 7 minutes since your previous plea for help and 16 minutes since your original request. People who answer here do so to help the community. If you need help right now then I suggest you pay for a support service. Otherwise you wait for the community to respond.
|
|
|
|
|
Deleting your other messages, especially as they have a response, is considered rude. It also disjoins the answer from the question. Should anyone have a similar problem and are searching the forum it will not help them find the answer.
lopashree wrote: plz give me ans that how to insert binary data into database by using vb.net?
The answer to your question is here[^]
|
|
|
|
|
hi,
I have a problem with my VB.NET project.
I cannot open the properties window of the project anymore while it was working before.
And if I try to open a form with the Visual Basic Form Editor, it gives me the error:
"There is no editor available for .vb.
Make sure the application for the file type (.vb) is installed"
and i cannot open also the file .resx:
"Make sure the application for the file type (.resx) is installed"
Any help?
Regards,
|
|
|
|
|
I think you registration file type for .vb and .resx file is deleted
Please check from Win Explorer - Tools - Folder Options - File Types
Search for vb and resx file extensions, if not exist create new for
vb and resx file extensions and related it with correct application
|
|
|
|
|
well thanks for your suggestion, but I 've already reinstalled the framework and everything's back to normal.
|
|
|
|
|
hi,
I have a problem with my VB.NET project.
I cannot open the properties window of the project anymore while it was working before.
And if I try to open a form with the Visual Basic Form Editor, it gives me the error:
"There is no editor available for <filename>.vb.
Make sure the application for the file type (.vb) is installed"
and i cannot open also the file .resx:
"Make sure the application for the file type (.resx) is installed"
Any help?
Regards,
|
|
|
|
|
Did you have to post this twice?
|
|
|
|