|
militiaware wrote: Is there some way to solve the problem without using the form class and its size in the memory...because i don't need a form....
No. And, the size of a form that is invisible and does nothing is next to 0.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I know how to paint any control's background, like painting Form's background using event Form_Paint.
Now I painted Panel's background through event Panel_Paint, and wanted to save it as picture/image in any format (prefer jpeg). Tell me how can I do this in VB.NET.
Thanx
Iftikhar Ali
|
|
|
|
|
Create a Bitmap object instead, and paint on that.
---
b { font-weight: normal; }
|
|
|
|
|
Please give me brief example (code).
|
|
|
|
|
Create a bitmap:
Dim bitmap as Bitmap = New Bitmap(400, 400)
Create a graphics object for the bitmap:
Dim g as Graphics = Graphics.FromImage(bitmap)
Now you can use the graphics object do draw on the bitmap, then use the Save method of the bitmap to save it. Remember to dispose the bitmap when you are done with it.
---
b { font-weight: normal; }
|
|
|
|
|
Thanx,
Well the real problem is something else. Its:
I use DirectX to play video, which require any control to be an "owner" in which it plays video. Now I selected to play video in Panel control & wanted to save snapshot/picture of any paused frame. Thats taking picture from movie.
Now tell me the solution.
|
|
|
|
|
Why didn't you ask that in the first place, then? As far as I know, it's completely different, as the video is probably drawn directly to the screen, not painted using a graphics object. As the question is so different, I think that you should post is a new question.
---
b { font-weight: normal; }
|
|
|
|
|
OK I will. Thanx for all you did for me.
|
|
|
|
|
I use the following code to find the row number from MyDataTable.DefaultView where field1 = TextBox1.Text.
MyDataTable.DefaultView.Sort = "field1"
RowNumber = MyDataTable.DefaultView.Find(TextBox1.Text)
How do find the corresponding row number in MyDataTable?
Thanks.
|
|
|
|
|
I am a newish VB.NET user.
I have a windows form in a project that has two datasets.
I would like to take the datasets and the form to another project.
I copy the .xsd and .xsx files over then use "Add Existing Item"
I do the same for the form and use "Add Existing Item".
Unfortunately all the dataset details are missing in the form, and all the bound field information is blank.
What am I doing wrong? I have searched on web for hours and tried all sorts of things, apart from copying entire project into a new folder and then renaming it, which is not ideal, I don't know what to do!
|
|
|
|
|
I have an MDI application. The forms have the following style.
form_load()...
ControlBox = False
MaximizeBox = False
MinimizeBox = False
FormBorderStyle = FormBorderStyle.None
WindowState = FormWindowState.Maximized
end sub
I have Form1 open, and if i open Form2 and close Form2, Form1 gets activated again, which is fine. But it gets resized to a smaller size and even th following code in form1_Activated doesnt resize it back to its original size.
private sub form1_Activated(....)
Me.WindowState = FormWindowState.Maximized
Me.Height = mszForm.Height
Me.Width = mszForm.Width
end sub
What is going on? thanks for any help.
vk
|
|
|
|
|
How to set the connection to an access db using VB.Net without specifying the drive name.
With Best Regards,
Mayur
|
|
|
|
|
|
Use an application configuration file with the path in???
Use Project->Add Component and choose Application Configuration File???
|
|
|
|
|
Hey philipcj, thnx for your help. Could you please elaborate on the steps that you have provided. Since I am a fresher in .NET, if you could provide some examples, it would be great.
With Best Regards,
Mayur
|
|
|
|
|
Hi
If you add the app config file using the Add Component to Project that I mentioned previously, you can type values in as follows:-
<configuration>
<appsettings>
<add key="AppTitle" value="My Product Name">
<add key="TempDir" value="c:\windows\temp">
<add key="DbDir" value="c:\data\db">
Then you can use the following lines of code to retrieve the data:-
dim sAppTitle as string
sAppTitle = System.Configuration.ConfigurationSettings.AppSettings("AppTitle")
Suggest you read help for a bit more information, thats about as much as I know. I do know this replaces .ini files that I used to use in VB6.
To answer your question more directly, it may be that you can include the access db as part of the project and not have to specify the drive, just the name. I don't know how to do this however. There are a number of ways of connecting as any book will tell you, but all of them need a path at some point. So your problem is purely about being able to access the current directory. Maybe one of the samples I have seen that comes with VB does this - not sure, sorry! If I find it, I'll post it here.
Regards
Phil
|
|
|
|
|
I am about to implement a vb.net database application and one of the main requirements is for the user to be able to add user-defined fields. It is an inventory control application where the user should be able to add their own fields to tables. For example a database table on cars would have standard fileds ID, Make Model, etc, but the user needs to have the ability to add their own fields to these records. Are there any other good approaches/patterns that you would recommend for this. Any good code examples out there for this type of problem?
Puzzle
|
|
|
|
|
I would create a set of separate tables and make a one-to-one join with the real tables. That way you don't alter the original tables. So the user tables have a primary key that matches their original counterpart and the user can add their columns to that table. This way, if they break anything, they don't break the original columns.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Make one table for the field information (name, et.c.), and one table for the data.
Example:
Fields<br />
-+ FieldId int<br />
-- UserId int<br />
-- FieldName varchar(30)<br />
<br />
FieldData<br />
-+ CarId int<br />
-+ FieldId int<br />
-- FieldData varchar(100)
---
b { font-weight: normal; }
|
|
|
|
|
As the title,
I would like to convert .DOC, .XLS, .PDF, .PPT(not important) to JPEG.
Any article or free API?
Thank you!
|
|
|
|
|
Hi
I have a problem in visual basic 6. I want to stop
a sequence of program (Loop) using a button clik (Externally)
thanx in advance
by
KK
|
|
|
|
|
You have to call DoEvents in the loop to handle the message queue, or the program won't respond to events.
---
b { font-weight: normal; }
|
|
|
|
|
If you state more specific questions you probably get more replies.
Anyway if you mean how to interrupt a loop from outside in VB6 this a way:
Declare a global variable like Alive as boolean
Your loop will be:
Alive=True
While Alive
(...)
DoEvents
End While
In your button event:
Alive=False
That's it.
|
|
|
|
|
Hi all
I want to show the data on Datagrid control and having group by faciltity
please give any hints idea to do it
|
|
|
|
|
Hello,
how can i find out the number of rows in a datagrid.
Thanx,
chitranjan
more dash than cash!!!
|
|
|
|