|
Hi. I'm trying to access the windows forms generated code to change the connection strings so that they are not hard coded. I'm using an access database. Please let me know how to access the windows forms generated code in vb.net 2005.
Mr Oizo
|
|
|
|
|
next to the Form in the solution explorer there should be a '+'.
Click it and spot the file called *.designer.cs
|
|
|
|
|
Thanks. I didn't see that coz I needed to click "show all files" anyways now I gotta hunt down the connection string dat source.
Mr Oizo
|
|
|
|
|
May I add that it is generally not a good idea to change generated code since changes you make in the designer could change the generated code. Do this with caution
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanks man. I fell really stupid now....Didn't click "show all files" so i didn't know it was there
|
|
|
|
|
I don't have to click "Show All Files" :S but I am using C# so maybe it's different for the C# VS layout or for C# projects.
|
|
|
|
|
hi everyone,
can anybody tell me that how can i play or run a AVI file using vb.net ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
If you'd googled it, every exampe you'd have found would be using the windows media player control, except for the one or two that used managed directX
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
yeah, using managed DirectX fully
i did a media player using managed directX but had to install a third party codec as part of the installation process, to play the avi files.
u can try this if u dont have any other option.
phatkin
|
|
|
|
|
This is only because your AVIs used this codec, and would be the same no matter what you used. If you used avi without a foreign codec, or MPG or WMV, then it would just work
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
|
hai,
i want to draw a backgroun image on a resizable form. i tried Paint Form_Paint event as follows
e.Graphics.DrawImage( hImage , 0 , 0 , Me.width , Me.height )
this draws only at the updated portion of the window and the previous drawing remains the same, hwo can i draw image on entire window
|
|
|
|
|
before drawing clear the graphics
Me.CreateGraphics.Clear(Me.BackColor)
then redraw the background image
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
thanks its works !
but i think i should use Me.CreateGraphics.DrawImage(h, 0, 0, Me.Width, Me.Height) instead of PaintEventArgs
|
|
|
|
|
nitin3 wrote: but i think i should use Me.CreateGraphics.DrawImage(h, 0, 0, Me.Width, Me.Height) instead of PaintEventArgs
No, you should not.
You should use the Graphics object that is sent in the PaintEventArgs . It's already created for you, so there is no reason to create another Graphics object. Also, it's cropped to the control that is to be redrawn, so that you don't draw outside the control by mistake.
Further more, if you use Me.CreateGraphics.DrawImage(...) then you don't get any reference to the created Graphics object, so there is no way that you can dispose it properly, which you have to do if you create Graphics objects yourself.
---
single minded; short sighted; long gone;
|
|
|
|
|
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Me.CreateGraphics.Clear(Me.BackColor)
e.Graphics.DrawImage(hImg , 0, 0, Me.Width, Me.Height)
End Sub
when i using this code the image drawn on the stretched and the other portion of window fill with backcolor, plz tel me how to correct this code.
|
|
|
|
|
try using
e.graphics.clear(me.backcolor) instead of the me.create...
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
its not working
the below code works for me but Guffa told me that i should use PaintEventArs. If i using the following method to paint i should write the same code on Form_Resize.
is there any another method to show a stretched background image ???
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Me.CreateGraphics.Clear(Me.BackColor)
Me.Graphics.DrawImage(hImg , 0, 0, Me.Width, Me.Height)
End Sub
|
|
|
|
|
nitin3 wrote: Me.CreateGraphics.Clear(Me.BackColor)
Use e.Graphics instead of Me.CreateGraphics.
---
single minded; short sighted; long gone;
|
|
|
|
|
I think I have an alternative way to do this which is more elegant
In the constructor of your class you can add this line:
SetStyle(ControlStyles.ResizeRedraw, true)
then from that point windows will stop sending small redraw to part of the control and assume the whole control needs to be repainted when resized.
|
|
|
|
|
thanks, this solved my problem !!
|
|
|
|
|
Hi all,
I need to show the total of a column in datagridview. Actually I am not getting the event, as we have Item DataBound Event in ASP.NET is there any event in VB.NET also?
Please help me.
Thanks in advance.
|
|
|
|
|
MsgBox(DataGridView1.Columns.Count.ToString)
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
this will display the column count and I want the total of that column.
Ex:
Column1 Column2
12 14
10 15
-----------------------------
22 29
Please help me.
|
|
|
|
|
sorry, i can not get u properly in Previous message.
i m not sure about existance of any property of datagridview which is matched with your requirement.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|