|
I found nine bugs in that code. Nice work.
---
b { font-weight: normal; }
|
|
|
|
|
As januari first would be the first day of the year, it would be:
dt = dt.AddDays(dd - 1);
Or you could start from day zero:
Dim dt as DateTime = new DateTime(1999 + yy, 12, 31);
---
b { font-weight: normal; }
|
|
|
|
|
Oh, that's true. Sorry, looks like it's your turn to correct my answer
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks everyone! Here's what I came up with from the two suggestions and it works just like I was wanting.
Dim dayOfYear, shortYear, days, startingYear As String
dayOfYear = txtDay.Text
shortYear = dayOfYear.Substring(dayOfYear.Length - 2, 2)
Dim startingDate As DateTime = New DateTime(1999 + shortYear, 12, 31)
Dim result As DateTime
days = dayOfYear.Substring(dayOfYear.Length - 5, 3)
result = startingDate.AddDays(days)
I am new to VB and was a little confused by the types. 'varchar(10)' was not a valid type with the version I'm using(at least to my knowledge). Using string seemed to be the only way to get to the substring.
Thanks,
mwclassen
|
|
|
|
|
I have embedded wmp 11 into a form, and now want it to play a .sami file, however i get the sami file does not play, the file is in correct syntax etc, but i need to find a way to enable captions and subtitles in wmp 11 i think.
does anyone know how to do this?
Thanks in advance.
J
|
|
|
|
|
jady84 wrote: I have embedded wmp 11 into a form, and now want it to play a .sami file, however i get the sami file does not play.
That's because Windows Media Player only plays certain file types (.wmv, .wav etc.) I've never heard of a .sami file, if it's a custom audio/video file designed for a different media player, then Windows Media Player won't work.
Is a .sami file a audio or video file?
|
|
|
|
|
|
Read my 'image processing for dummies' articles, which are on the code project site, just do a search.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Sorry to bug you guys again, but...
If I have an object in the main program, I can link to it from the imported assembly by passing its name as an object in a method:
From the host:
Assemblysub(Me)
Is it possible to pass the host name as an object within the assembly class so that it can be visible to methods in the assembly that are not called by the host?
Just trying to make sense of what's pretty complicated for me.
Thanks again
|
|
|
|
|
Is it possible to create new objects on the main form from imported .dll assemblies?
I want to have a number of assemblies, each presenting different controls on the main form.
I see that I can call existing controls on the main form from the assemblies, but cannot see if I can place new controls on the main form from the assemblies.
thank you
|
|
|
|
|
If an assembly is imported into your project, then it's part of the project, you can do anything that you could do if the code was in your local assembly, with the exception that any methods marked internal only work in the assembly where they were written.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Let me try to explain my situation a bit more.
I have a main project that may or may not import a subassembly. I'd like to have the subassembly, when it is available, display its form within the form of the main form (or alternatively, create new objects on the main form).
I guess it's like I want to create an object on Form1 from Form2. Normally, you wouldn't need to do that. But if Form2 is only constructed at runtime, when its assembly is loaded, there is no way to know what to put on Form1 ahead of time.
Does this make any sense?
Thanks again.
|
|
|
|
|
Hey
Just wondering if it is possible to use VBA to make it so that Outlook imposes a button on the "paper" of each email eg:
An email comes in and outlook places a button at the top of the message that allows the user to perform an action.
Cheers
Dan
|
|
|
|
|
Hai all,
Iam doing an application in asp.net with vb.....
my application generates a series of documents.....
i need to have all those generated files intoa single zipfile with link button and later can be downloaded to any place like desktop.....
can any one help me in this case.....
as soon as possible.....
thnks in advance
amar
|
|
|
|
|
|
using SQLServer 2005
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
please edit your original post.
don't make a new post
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
please answer if u Know.
don't Abuse or Spam the posts
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
|
Hi guys,
I've hit a huge brickwall in my project here. I've made use of the VB6 appbar which is docked above the Windows taskbar at runtime.
When it crashes for whatever reason, and is restarted - the appbar appears above the previously docked space - thus creating an invisible gap above the taskbar.
Windows thinks the crashed appbar still exists, as it hasn't been unregistered properly due to the crash.
To manually fix this, I could click on the taskbar to resize it (When it is not locked) and it would remove that gap and the toolbar would then move down to the space it should be in.
What I need is a way to programmatically do this within my application so I could check a flag and refresh the desktop workspace to eliminate the gap.
I've looked around and tried a desktop icon refresh, to no success.
Please help!!!
Steve Rad
|
|
|
|
|
Hi
I want to add a alpa channel to a picture and save it to use it as a icon. i can draw on a picture and save it but i dont know how to add the alpha channel(and save it)?Im a newbi to programminmg.
This is the code i use:
________________________________________________________________
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
Inherits System.Windows.Forms.Form
Private objBitmap As Bitmap
Private objGraphics As Graphics
Private strImgFile As String = "test.bmp"
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
objBitmap = New Bitmap(200, 200, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
objGraphics = Graphics.FromImage(objBitmap)
Dim img As Image = Image.FromFile(Environment.CurrentDirectory & "\" & "yukon.gif")
objGraphics.DrawImage(img, 0, 0)
End Sub
Dim path As New GraphicsPath
Dim prevPt As New Point(100, 100)
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
e.Graphics.DrawPath(Pens.Black, path)
End Sub
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
prevPt.X = e.X
prevPt.Y = e.Y
path.StartFigure()
End If
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim g As Graphics = PictureBox1.CreateGraphics
Dim currPt As Point = New Point(e.X, e.Y)
'g.DrawLine(Pens.Black, prevPt, currPt)
objGraphics.DrawLine(Pens.Black, prevPt, currPt)
path.AddLine(prevPt, currPt)
prevPt = currPt
PictureBox1.Image = objBitmap
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
If MessageBox.Show("Bild speichern als " & strImgFile & " ?", _
"Bild speichern?", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
objBitmap.Save(strImgFile, System.Drawing.Imaging.ImageFormat.Bmp)
MessageBox.Show("Bild wurde gespeichert als " & strImgFile, _
"Bild wurde gespeichert", MessageBoxButtons.OK, _
MessageBoxIcon.Information)
If MessageBox.Show( _
"Bilddatei mit dem Standardprogramm öffnen?", _
"Bilddatei öffnen?", MessageBoxButtons.YesNo, _
MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
Dim p As Process = Process.Start("test.bmp")
End If
objBitmap.Dispose()
End If
End Sub
_________________________________________________________________________
|
|
|
|
|
There is no alpha channel in a bmp. The file format doesn't support it. Some people think a 32 bpp bitmap has an alpha channel, but it's not the case. The extra byte per pixel is unused.
If you want to draw a bitmap transparently, set a mask color and use the ImageAttributes class to call DrawImage on the Graphics class, with a transparency range selected.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
How do I validate the entries in a DataGrid to ensure that the user is filling the grid in correctly?
For example, if the user enters a price for 1 to 10 units as being £1.00 on the first row, but they accidentally enter a second price on the second row for 9 to 20 units as £0.90 - how do I catch it (i.e. it should be 11 - 20 units)?
|
|
|
|
|
you can declare the datatable that the datagrid is sourceing as an instance variable with events
<br />
Friend Withevents tab as Datatable<br />
Then you can handle a variety of events related to editing that table such as NewRow and RowChanged
|
|
|
|
|
Hi friends
How to download a file stored in a web folder using VB 6
thanx in advance
KK
|
|
|
|