|
|
hello,
i want to know is any validation controls are avilable for desktop application in .net 2005 or other alternative of doing it.
|
|
|
|
|
No. But there is a validation event you can customise. I can't remember the precise details.
|
|
|
|
|
can u be more precise.
thanks
|
|
|
|
|
Search for "validation in Windows Forms" on MSDN and you'll find everything your looking for.
Depending on your needs, you may want to pay particular attention to this[^] article in the search results.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Ok so i made a picturebox, and i used the e.graphics.drawimage method to draw an image onto in, now i want that image to be stored into bitmap object. so i can save it into a file.
********************
Private Sub picturebox3_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles picturebox3.Paint
Dim brt As Single = hbarBrightness.Value / 1000
Dim image_attr As New Imaging.ImageAttributes
Dim cm As Imaging.ColorMatrix = New Imaging.ColorMatrix(New Single()() { _
New Single() {brt, 0.0, 0.0, 0.0, 0.0}, _
New Single() {0, brt, 0.0, 0.0, 0.0}, _
New Single() {0.0, 0.0, brt, 0.0, 0.0}, _
New Single() {0.0, 0.0, 0.0, 1.0, 0.0}, _
New Single() {0.0, 0.0, 0.0, 0.0, 1.0}})
Debug.WriteLine(brt)
Dim myrect As New RectangleF(0.0F, 0.0F, picturebox3.Width, picturebox3.Height)
Dim rect As Rectangle = Rectangle.Round(myrect)
Dim wid As Integer = b.Width
Dim hgt As Integer = b.Height
image_attr.SetColorMatrix(cm)
e.Graphics.DrawImage(PictureBox1.Image.Clone, rect, 0, 0, wid, hgt, GraphicsUnit.Pixel, image_attr)
end sub
******************
so how i get the image drawn at location to be saved into a bitmap object?
|
|
|
|
|
PowerStorm wrote: Ok so i made a picturebox, and i used the e.graphics.drawimage method to draw an image onto in
Weird. Why use a picturebox at all ? Why not just store Bitmap objects in your class and draw them, given that you're wastefully making a copy of the image every time here, and apart from that, you may as well be handling the paint event direct to your form ?
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 )
|
|
|
|
|
You really shouldn't be drawing on the surface of the PictureBox. You should instead be drawing on a Bitmap object, then showing the newly updated bitmap in the PictureBox, or whatever other control your showing it with.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hey guys
i m using vb.net and sql server 2000
i want to validate my textboxes in the sence that
whenever i left any of the text box empty,, data dont get stored in database
and i get message that ""fill up form properly"
please help me
i will really appreciate it....
|
|
|
|
|
You can use string.IsNullOrEmpty to check the text of each textbox. Or you can use validators and set them to fail if the control is empty.
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 )
|
|
|
|
|
how do i store RTF text into access database? i need to retrieve that text later on to use in crystal reports....any method????
|
|
|
|
|
RTF is just Text, so you can store it in a Memo field in Access. I don't know what the limitations are on using that in Crystal Reports though since I don't use CR.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
This code is from javascript as below.
var lunarInfo=new Array(
0x4bd8,0x4ae0,0xa570,0x54d5,0xd260,0xd950,0x5554,0x56af,0x9ad0,0x55d2,
0x4ae0,0xa5b6,0xa4d0,0xd250,0xd295,0xb54f,0xd6a0,0xada2,0x95b0,0x4977,
0x497f,0xa4b0,0xb4b5,0x6a50,0x6d40,0xab54,0x2b6f,0x9570,0x52f2,0x4970,
0x6566,0xd4a0,0xea50,0x6a95,0x5adf,0x2b60,0x86e3,0x92ef,0xc8d7,0xc95f,
0xd4a0,0xd8a6,0xb55f,0x56a0,0xa5b4,0x25df,0x92d0,0xd2b2,0xa950,0xb557,
0x6ca0,0xb550,0x5355,0x4daf,0xa5b0,0x4573,0x52bf,0xa9a8,0xe950,0x6aa0,
0xaea6,0xab50,0x4b60,0xaae4,0xa570,0x5260,0xf263,0xd950,0x5b57,0x56a0,
0x96d0,0x4dd5,0x4ad0,0xa4d0,0xd4d4,0xd250,0xd558,0xb540,0xb6a0,0x95a6,
0x95bf,0x49b0,0xa974,0xa4b0,0xb27a,0x6a50,0x6d40,0xaf46,0xab60,0x9570,
0x4af5,0x4970,0x64b0,0x74a3,0xea50,0x6b58,0x5ac0,0xab60,0x96d5,0x92e0,
0xc960,0xd954,0xd4a0,0xda50,0x7552,0x56a0,0xabb7,0x25d0,0x92d0,0xcab5,
0xa950,0xb4a0,0xbaa4,0xad50,0x55d9,0x4ba0,0xa5b0,0x5176,0x52bf,0xa930,
0x7954,0x6aa0,0xad50,0x5b52,0x4b60,0xa6e6,0xa4e0,0xd260,0xea65,0xd530,
0x5aa0,0x76a3,0x96d0,0x4afb,0x4ad0,0xa4d0,0xd0b6,0xd25f,0xd520,0xdd45,
0xb5a0,0x56d0,0x55b2,0x49b0,0xa577,0xa4b0,0xaa50,0xb255,0x6d2f,0xada0,
0x4b63,0x937f,0x49f8,0x4970,0x64b0,0x68a6,0xea5f,0x6b20,0xa6c4,0xaaef,
0x92e0,0xd2e3,0xc960,0xd557,0xd4a0,0xda50,0x5d55,0x56a0,0xa6d0,0x55d4,
0x52d0,0xa9b8,0xa950,0xb4a0,0xb6a6,0xad50,0x55a0,0xaba4,0xa5b0,0x52b0,
0xb273,0x6930,0x7337,0x6aa0,0xad50,0x4b55,0x4b6f,0xa570,0x54e4,0xd260,
0xe968,0xd520,0xdaa0,0x6aa6,0x56df,0x4ae0,0xa9d4,0xa4d0,0xd150,0xf252,
0xd520);
I cannot very understand what is this.
Can vb do this? If can, how?
Thanks very much.
|
|
|
|
|
the syntax is like this:
Dim ia() As Int16 = {0, 1, 2}
vb - does not like values like 0xc960 however...
|
|
|
|
|
It's an array of integers:
Dim lunarInfo As Integer() = { &H4bd8, &H4ae0, &Ha570, &H54d5, &Hd260, &Hd950, &H5554, &H56af, &H9ad0, &H55d2, _
&H4ae0, &Ha5b6, &Ha4d0, &Hd250, &Hd295, &Hb54f, &Hd6a0, &Hada2, &H95b0, &H4977, _
.
.
.... }
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I must say thanks to both of you.
But, your answers look like different.
Which one is correct?
int16 or integer?
And VB really can use the code like "&H4bd8",Dave Kreskowiak?
Really thanks again.
|
|
|
|
|
Int16 is a signed 16-bit integer. Integer is a signed 32-bit integer. The number you're looking at would all fit into 16-bit integers, but which type you use would depend on the math you're doing. I would assume that these numbers are used in other calculations which may involve floating poiint math, so using full processor-width numbers would probably make your app perform a bit better.
And yes, VB can understand &H4BD8. The "&H" just means that this constant is specified in hexadecimal format.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I'm writing a text editor program, what I want to know is when attempting to print to a non-existent printer the program still sends the document to the print queue.
How do I tell the user that no printer is available and cancel the document from being sent to the printer queue?
|
|
|
|
|
Anybloodyid wrote: when attempting to print to a non-existent printer
If the printer doesn't exist, you can't print to it. Are you asking if the printer object exists, but is unavailable??
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Why would you want to do this? I've paused print queues before so I could stack up jobs and go load different paper into a printer before they printed. Isn't this an option best left up to the user?
Ask yourself these questions first. Have you seen this kind of functionality in any other Windows app before? Why or why not?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hello,
Looking for everyone's opinion:
If my application references files/objects that aren't actually used in the app. does this "hurt" performance or is dotnet smart enough to realize that those aren't used so there is no performance hit.
Ex: I have a suite of controls that most of the time only 2 or 3 are used out of 10. I have a developer that referenced all 10 even though his app only used 2, then does the other 8 make an impact?
Thanks,
Nathan
-- modified at 14:12 Monday 2nd April, 2007
|
|
|
|
|
nlarson11 wrote: If my application references files/objects that aren't actually used in the app. does this "hurt" performance
No. Only the stuff that gets used affects performance.
nlarson11 wrote: Ex: I have a suite of controls that most of the time only 2 or 3 are used out of 10. I have a developer that referenced all 10 even though his app only used 2, then does the other 8 make an impact?
No. Again, only the stuff that gets used affects performance. If you don't use a control in a library, it can't affect the apps performance. That is, unless the library is HUGE in size and it takes forever to load the assembly. But 10 controls in your library won't make any difference at all.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks Dave for replying...
Sorry for not being more clear...I guess that what I'm really getting at: the start up time...is it impacted by "dead" references?
|
|
|
|
|