|
Okay this looks nasty. Real Nasty. So here's the code.
Its supposed to be three parallel color polygons but, it doesn't look like that.
This is the first time i'm using the gradient brush so, if any of the experienced Vb programmers could help me make it look neater than what it is, that would be appreciated.
Private Sub frmSplash_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
'Declares procedure level varaibles.
Dim brGradient As System.Drawing.Drawing2D.LinearGradientBrush
Dim points() As PointF
'Defines the rectangle.
Dim clientRectangle As New System.Drawing.Rectangle(0, 0, _
Me.Width, Me.Height)
'Sets the Gradient Brush color for the red polygon.
brGradient = New System.Drawing.Drawing2D.LinearGradientBrush(clientRectangle, _
Color.Black, Color.Red, _
System.Drawing.Drawing2D.LinearGradientMode.Horizontal)
'Draws the points for the red polygon.
points = New PointF() {New PointF(0, 0), _
New PointF(0, 30), _
New PointF(ToSingle(Me.Width / 2.3), 320), _
New PointF(ToSingle(Me.Width / 2), 320), _
New PointF(ToSingle(Me.Width / 2), 295), _
New PointF(35, 0), _
New PointF(0, 0)}
'Fills the red polygon using the points and gradient brush.
e.Graphics.FillPolygon(brGradient, points)
'Closes the Gradient brush.
brGradient.Dispose()
'Sets the Gradient Brush color for the green polygon.
brGradient = New System.Drawing.Drawing2D.LinearGradientBrush(clientRectangle, _
Color.Black, Color.Green, _
System.Drawing.Drawing2D.LinearGradientMode.Horizontal)
'Draws the points for the green polygon.
points = New PointF() {New PointF(125, 0), _
New PointF(125, 30), _
New PointF(400, 320), _
New PointF(435, 320), _
New PointF(435, 295), _
New PointF(160, 0), _
New PointF(125, 0)}
'Fills the green polygon using the points and gradient brush.
e.Graphics.FillPolygon(brGradient, points)
'Closes the Gradient brush.
brGradient.Dispose()
'Sets the Gradient Brush color for the blue polygon.
brGradient = New System.Drawing.Drawing2D.LinearGradientBrush(clientRectangle, _
Color.Black, Color.Blue, _
System.Drawing.Drawing2D.LinearGradientMode.Horizontal)
'Draws the points for the blue polygon.
points = New PointF() {New PointF(255, 0), _
New PointF(255, 30), _
New PointF(525, 320), _
New PointF(560, 320), _
New PointF(560, 295), _
New PointF(290, 0), _
New PointF(255, 0)}
'Fills the blue polygon using the points and gradient brush.
e.Graphics.FillPolygon(brGradient, points)
'Closes the Gradient brush.
brGradient.Dispose()
Ty
-- modified at 11:54 Tuesday 14th March, 2006
|
|
|
|
|
Replace ToSingle with CSng. You have created polygons. But those polygons don’t look like what you have expected. Try to change x- and y-coordinates of PointFs according to you preference.
chatura
|
|
|
|
|
What does CSng mean and what does it do?
Ty
|
|
|
|
|
converts to single data type
chatura
|
|
|
|
|
Hi all,
1-I need to use custom paper size using crystal report in vb.net, how can I ?
2-Is there any way to create custom paper size and include it in printer paper size collection using printer properties at windows level ?
Thanks in advance
|
|
|
|
|
The first step is to see if your printer driver can support custom paper size settings - the PrinterSettings.PaperSizes property lists all the paper sizes supported by a printer and if this collection includes a paper size with .Kind = PaperKind.Custom then it can.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hello,
Its supporting for custom kind . please let me know the details. and also let me know how to assign "CrystalObject" (object of .rpt) to "PrintDocument" object. Thanks
|
|
|
|
|
Yes , I found the way to add custom paper size in the printer collection of paper sizes.
Start -> Settings -> Printers and Faxes -> right click in the window -> Server Settings -> Create form ,give width & height and save the form with new name. now you have custom paper size in collection of printer.
Be sure,while creating form that you have selected the required printer driver.
Enjoy the Solution......
|
|
|
|
|
|
Hello
Lately I have a problem when I try to run a project with debugging (shortcut F5). I get the following message, for ANY project:
---------------------------
Microsoft Development Environment
---------------------------
Error while trying to run project: Unable to start debugging.
Unable to start program 'C:\Documents and Settings\urim\My Documents\Visual Studio Projects\WindowsApplication8\WindowsApplication8\bin\WindowsApplication8.exe'.
No such interface supported
If I run without debug (CTRL+F5), it works fine.
What is the problem ? Can anyone please help?
Thanks ahead.
Uri.
|
|
|
|
|
Might I suggest digging into Microsoft's Knowledge Base, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
when i try to show a form which is on hide "me.hide" it have error.. i dont want to use the "me.close" casue if i use that whole the system will exit...i dunno y.. any way to show the hide form??
|
|
|
|
|
|
JOY
Hai,
I am working on a student database project in Vb.net. I have established a connection betwen Ms-Access table & my form through DATASET. Now i am able to save & retrive the records.
what i want is to store the photograph of students.
if i am not wrong, we can use imagelist so that the photos can be displayed.but how to connect it from the access table .
My second question is to know how to store & retrive the photos.so that whenever i move to a particular student's record ,his photo should appear.Can u pl help me with an example for a clear understanding
if photos cannot be stored in a databae then what could be an alternative to this. pl exlain briefly if so.
Arun
|
|
|
|
|
In the past I would usually store the image NAME (ie. in a "Image_PathFileName" field. This way when I run through my recordsets I can retrieve the image by pulling the Image_PathFileName value and plugging it into my code.....
-Kay
|
|
|
|
|
|
You can use as folllowing
1- get the path using Open file dialogue in text box as I taken in txtCompanyLogo.text
2-
Dim arr() As Byte
If Trim(txtCompanyLogo.Text) <> "" Then
FileOpen(1, txtCompanyLogo.Text, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
'Resize array so that it can accomodate the file
ReDim arr(FileLen(txtCompanyLogo.Text) - 1)
FileGet(1, arr)
FileClose(1)
'/////// Ds is DataSet & CompanyInfo is TableName & CompanyLogo is Field Name for Binary Data ////////////
ds.Tables("CompanyInfo").Rows(0).Item("CompanyLogo") = arr
End If
Enjoy Solution
|
|
|
|
|
Hello,
I used to display binary image in VB 6.0 using the following code:
<br />
<br />
dim byteImage() as byte<br />
' assuming byteImage() has value display the image using PICTUREBOX object<br />
picturebox1.image.hpal = byteImage<br />
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB6.0?
|
|
|
|
|
I'm sorry about that last line:
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB6.0?
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB.NET?
|
|
|
|
|
check this
http://www.vbdotnetheaven.com/UploadFile/mahesh/BLOBinAdoDotNet04232005065613AM/BLOBinAdoDotNet.aspx?ArticleID=61566715-97c5-47cd-a8d4-d254cb8309cd
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
|
I'm sorry about that last line:<br />
<br />
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB6.0?<br />
<br />
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB.NET?
i thing he searched in vb.net
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
i am getting above error while trying to do following.. i tried hard but dont know what went wrong,
=========
'##############
'check for existance of userID in database
Function CheckUserName(ByVal userID As String) As DataSet
objConn = New SqlConnection(dbPath)
cmd = New SqlCommand("select username from userPersonalDetails where username='" & Replace(txtUserName.Text, "'", "''") & "'", objConn)
Dim dataAdapter As SqlDataAdapter = New SqlDataAdapter
dataAdapter.SelectCommand = cmd
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
'check for existance of users email address in database
Function CheckEmail(ByVal email As String) As DataSet
objConn = New SqlConnection(dbPath)
cmd = New SqlCommand("select emailaddress from userPersonalDetails where emailaddress='" & Replace(txtEmail.Text, "'", "''") & "'", objConn)
Dim dataAdapter As SqlDataAdapter = New SqlDataAdapter
dataAdapter.SelectCommand = cmd
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If Page.IsValid Then
Dim userDS As New DataSet
userDS = CheckUserName(txtUserName.Text)
Dim emailDS As New DataSet
emailDS = CheckEmail(txtEmail.Text)
If userDS.Tables(0).Rows.Count = 1 Then
'userid exists so display a message
lblMsg.Text = "That UserID Exists. Please Pick Another"
ElseIf emailDS.Tables(0).Rows.Count = 1 Then
'email address exists so display a message
lblMsg.Text = "Someone has registered with that Email address."
Else
cmd = New SqlCommand("insert into userPersonalDetails values('" & Replace(txtUserName.Text, "'", "''") & _
"','" & Replace(txtPassword.Text, "'", "''") & _
"','" & Replace(txtEmail.Text, "'", "''") & _
"','" & Replace(txtFullName.Text, "'", "''") & _
"','" & Replace(txtMobPhone.Text, "'", "''") & _
"','" & Replace(txtHomePhone.Text, "'", "''") & _
"','" & Replace(txtWorkPhone.Text, "'", "''") & "',0);", objConn)
objConn.Open()
cmd.ExecuteNonQuery()
'Response.Write(cmd.CommandText)
objConn.Close()
end if
end if
end sub
many many thanks in forward
robin
|
|
|
|
|
What line does the error show up on?!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
please disregard this post in my aspx page the label was not created but in my vb it was declared so it was complaining about lblmsg sorry thanks for your help.
|
|
|
|
|