|
hi all,
In my program, i have multiple point. these points can make different closed diagram but i have no idea that how can i draw a diagram on the basis of point. I want to ask whether there are any class in .Net which take different point and draw closed diagram on the basis of point ? I am using visual studio 2005
|
|
|
|
|
I guess DrawClosedCurve method of Graphics class will help you.
|
|
|
|
|
Thanks danish,
I want to know one more thing. Whether there are any method to fill this area to any color ?
|
|
|
|
|
FillClosedCurve?
If you use Object Browser you will find everything in Graphics class.
|
|
|
|
|
I am working on a project with 1 Grandparent 1 parent and multiple grandchildren
The following are tables and their configuration
Grandparent : Equipment
Fields : Eqpt_ID (PK) etc...
Parent : Equipment_Task
Fields : EQPT_TASK_ID (PK), EQPT_ID (FK), etc...
Grandchildren1 : Task_Procedure
Fields : TASK_ID(pk), EQPT_TASK_ID (FK)etc...
The Equipment table connects to Equipment_Task Table through EQPT_ID
and the Eqpt_Task connects to Task_procedure Table through EQPT_TASK_ID
This is how the dataset is organized :
Dim Table0 As New tblEquipment ' Grandparent
Dim Table1 As New tblEQPT_Task '
Dim Table2 As New tblEqptTaskProcedure
MyBase.Tables.Clear()
MyBase.Relations.Clear()
MyBase.Tables.Add(v_Table0)
MyBase.Tables.Add(v_Table1)
MyBase.Tables.Add(v_Table2)
Dim myDataRelation = New DataRelation("EqptTaskProcedure", Table1.Columns("EQPT_TASK_ID"), Table2.Columns("EQPT_TASK_ID"))
myDataRelation.nested = True
MyBase.Relations.Add(myDataRelation)
.
.
.
I have the following codes in my form
BindingSource1.DataMember = ""
BindingSource1.DataSource = dstEquipment.tblEquipment
The following code works
dgvEqpt_Task.DataSource = dstEquipment.tblEQPT_TASK
dgvEqpt_Task.Columns(0).DataPropertyName = "Task_Code"
While this does not work ?
Me.DataGridView1.DataSource = dstEquipment.tblEqptTaskProcedure
Me.DataGridView1.Columns(0).DataPropertyName = "Line_No"
dstEquipment.BindingSource = BindingSource1
BindingSource2.DataMember = ""
BindingSource2.DataSource = dstEquipment.tblEQPT_Task
can somebody help me please?
Empty your cup and have it filled
|
|
|
|
|
Hai friendz....
I would like to know how to write into files using vb.net 2005.
I like to save the passwords of my application in a encrypted text files .
I will be thank ful to you if you are providing me the solution.
Ihope you will...................
REVATH S KUMAR
|
|
|
|
|
revath wrote: I will be thank ful to you if you are providing me the solution.
I bet you would, getting code for free. Try rentacoder.com, or wrte your own code. There are thousands of examples on Google.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Nobody here is going to write your code for you.
Reading and writing text files is basic stuff and there are plenty of examples if you google them.
There is a standard set of functions within the .NET framework for excryption including MD5 (see the System.Security.Cryptography namespace).
I would encrypt the password (using MD5 for example) then write the encrypted password to your file.
To validate the password, encrypt the user enter password using the same encrytion method and see if the user enter encrypted password matches the encrypted password stored in the file.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I'm trying to make this application appear in the bottom right of the screen no matter what resolution the screen is at so I created this code.
Dim Width1 As Integer = Screen.PrimaryScreen.Bounds.Width
Dim Height1 As Integer = Screen.PrimaryScreen.Bounds.Height
Dim X As Integer = Me.Location.X
Dim Y As Integer = Me.Location.Y
X = (Width1 - Me.Width)
Y = (Height1 - Me.Height)
Which runs when a button is clicked however, whenever the button is clicked nothing happens so I changed the X and Y on the bottom two lines to Textbox1.Text = (Width1- Me.Width) and Textbox2.Text = (Height1 - Me.Height) and the textboxes showed the correct numbers.
What is wrong with my code? I know it deals with the Me.Location.X and Me.Location.Y but am unsure why. Thanks for your help in advance.
modified 8-Sep-21 21:01pm.
|
|
|
|
|
Uhhh, if this is all of the code, you didn't set the location to the new values.
Me.Location = New Point(X, Y)
|
|
|
|
|
Hi,
you can condense that to the single statement
Me.Location = New Point(Screen.PrimaryScreen.Bounds.Width-Me.Width,<br />
Screen.PrimaryScreen.Bounds.Height-Me.Height)
This may or may not require a correction depending on how you want to deal with the task bar.
|
|
|
|
|
Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal hwndParent As Integer, ByVal ByValfRequest As Integer, ByVal lpszDriver As String, ByVal lpszAttributes As String) As Integer
Private Const vbAPINull As Integer = 0 ' NULL Pointer
Private Const ODBC_ADD_DSN As Short = 4 ' Add data source
Private Const ODBC_REMOVE_DSN As Short = 6 ' Remove data source
Public Sub Create_System_DSN()
Dim intRet As Integer
Dim Driver As String
Dim Attributes As String
'Set the driver to SQL Server because it is most common.
Driver = "Microsoft Access Driver (*.MDB)"
Attributes = "DSN=Sipe" & Chr(0)
Attributes = Attributes & "DESCRIPTION=Sipe ODBC Connection" & Chr(0)
Attributes = Attributes & "DBQ=F:\Sipe.mdb" & Chr(0)
'To show dialog, use Form1.Hwnd instead of vbAPINull.
intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, Driver, Attributes)
If intRet <> 0 Then
MsgBox("DSN Created")
Else
MsgBox("Create Failed")
End If
End Sub
Above code in a form with a button click is working fine
Need help on how to create the same DSN after installing a software
Saseendran Kombath
modified on Sunday, November 2, 2008 12:07 PM
|
|
|
|
|
You'd probably use a custom action in your installer, or provide such a function in your application.
|
|
|
|
|
Thanks for your reply
I am using a custom action for registering a dll as below, I am not sure where to use the DSN creation code I have searched several places but didn't get any guide lines. I am sure You can help me in this
Public Sub New()
MyBase.New()
AddHandler AfterInstall, AddressOf AfterInstallEventHandler
AddHandler BeforeUninstall, AddressOf BeforeUninstallEventHandler
End Sub
Private Sub BeforeUninstallEventHandler(ByVal sender As Object, ByVal e As InstallEventArgs)
' Add steps to perform any actions before the Uninstall process.
Process.Start("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe", _
String.Format("/u ""{0}""", _
Path.Combine(My.Application.Info.DirectoryPath, "Sipe.dll")))
Console.WriteLine("Code for BeforeUninstallEventHandler")
End Sub 'BeforeUninstallEventHandler
Private Sub AfterInstallEventHandler(ByVal sender As Object, _
ByVal e As InstallEventArgs)
' Add steps to perform any actions after the install process.
Process.Start("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe", _
String.Format("/codebase ""{0}""", _
Path.Combine(My.Application.Info.DirectoryPath, "Sipe.dll")))
Console.WriteLine("Code for AfterInstallEventHandler")
End Sub 'AfterInstallEventHandler
Saseendran Kombath
|
|
|
|
|
You put it in the same place you registered your .DLL. Since I never use DSN's nor ODBC for anything anymore, ...
|
|
|
|
|
Thanks for your immediate response, I will try the same
Thanks a lot
Saseendran Kombath
|
|
|
|
|
After adding the same in to Installer and Installer class to custom action it is working fine
thanks for your advice
Saseendran Kombath
|
|
|
|
|
Hii
I want to create .CAB file using win zip. how i do this. please suggest.
Thanx
Mitesh
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
IIRC, you have to use WinZip's command line support utility to do something like this. Never used it myself though.
|
|
|
|
|
You might be better off using an open source, third-party, .NET compliant library that is better suited for programming than using WinZip. This might help: Google Search for open source zip library .net[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I've used DotNet Zip and it worked fine for what I was doing.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
No
I want to create a cab file using win zip.that must be run on mobile devices.
Please suggest how i do this.
Thanks
Khatri Mitesh
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
I want to make magnifier for image.so i want 4 pixels works as 1 pixel for image which in picBox and when i draw on that image than also 4 pixels works as 1 pixel.i sent a small code which only draw large image but not change pixel size.so give me some idea for change pixel size of that picbox.
Thanks
"This is code of PaintEvent of picbox"
picbox.image=image.fromfile(anyfile)
dim bm as bitmap
bm=picbox.image
Dim wid, hig As Single
wid = bm.Width
hig = bm.Height
wid = wid * 2
hig = hig * 2
Invalidate()
e.Graphics.DrawImage(bm, 1, 1, wid, hig)
PicBox.Width = wid
PicBox.Height = hig
Vineet Swami
Isol
|
|
|
|
|
You can't change the pixel size of a bitmap, a pixel is always a pixel. It sounds like all that you want to do is to display the image at double scale, which you already have done. If you draw on the bitmap it will show up scaled when you display it.
Vineet Swami wrote: PicBox.Width = wid
PicBox.Height = hig
Don't change the size of the control from the paint event. That will cause another repaint.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
none of the code you have shown belongs in the Paint handler of a PictureBox,
because 1) a PictureBox does its own painting anyhow, and 2) the code
shown should not execute every time the PB needs being repainted.
There are two ways to do what you want, depending on the details of what
you want:
1.
simply scaling up an image is something a PictureBox does naturally.
Just make the PB twice as large as the image is, and set its
SizeMode to PictureBoxSizeMode.StretchImage
This can be handled in the Visual Designer, without adding your own code.
Doing so the PB will use interpolation to calculate the new pixels,
which is fine for displaying pictures etc.
2.
if you want to replicate the existing pixels (e.g. because you want to
create a pixel editor), without calculating new pixels, it is a bit more
complex. There are again two ways:
2a.
calculate a new image yourself, twice as large; use two nested loops,
and the Image.GetPixel() and SetPixel() methods, unless performance is
very important (then use unsafe code and pointers)
Do this in a method that runs only once, e.g. the Form's Load handler.
2b.
Use a Panel instead of a PictureBox, provide your own Paint handler that
sets Graphics.InterpolationMode to InterpolationMode.NearestNeighbor
and draws the image yourself with Graphics.DrawImage.
If the borders need to be accurate too, you need a more elaborate DrawImage
overload that allows you to apply a translation over half a pixel in both
dimensions.
modified on Saturday, November 1, 2008 1:16 PM
|
|
|
|