|
In my code I creat a piechart.
What I have done is stripped down the code to show you what goes where (This code will not work as it needs declarations and values...).
This code will in effect make the picture 'stick' to the form - so that it does not get erased as you move the form.
Panel1 is where the piechart is being drawn.
Width and Height are variables you need to set to the size of the picture you want.
You will also need to include the Panel1.CreateGraphics.DrawImage(b1, 0, 0) command in the Paint event of the objetct you are drawing onto - in fact this is where the magic of this method is...
Give this a go and good luck...
Regards
Guy
Cambridge
UK
Public b1 As Bitmap
Public g1 As Graphics
b1 = New Bitmap(Width, Height, Panel1.CreateGraphics())
g1 = Graphics.FromImage(b1)
g1.DrawPie(Pen:=myPen, rect:=New Rectangle _
(x:=x + XAdjust, y:=y + yAdjust, Width:=Width, Height:=Height), _
startAngle:=startPos, sweepAngle:=sweep)
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
Panel1.CreateGraphics.DrawImage(b1, 0, 0)
End Sub
You always pass failure on the way to success.
|
|
|
|
|
hi
i am very amator in vb.net i want build an editor program like notepad whit vb.net but i cannot build menu and their code like open in file submenu and save and ...
please guide me and help.
thanks a lot
|
|
|
|
|
Really, your best bet is to buy a book and work through it, or look for some tutorials online. Building a menu is simply a case of dragging it onto your form, and clicking where you want menu items to be, to add them. Making them do something is as simple as double clicking on them in the editor. The code is also fairly simple, just use the FileOpenDialog and FileSaveDialog classes.
But, again, if you're asking this, you're probaby enough of a beginner, that you really need to rely on a book to get you started, as you'll get more structured and consistent help than you cn get from forum replies.
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 )
|
|
|
|
|
hi
i am very amator in vb.net programming i want build a editor program like notepad in vb.net but i cannot build menu and their code for menu like open frome file submenu and save and ...
please help and guid me
thanks a lot
|
|
|
|
|
Hi experts,
I need a vb script(.vbs) to convert a Excel file to Html file. Is it possible?????
Regards....Sagar
|
|
|
|
|
Of course it is possible. Anything is possible when you are programming!
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Iam creating a Text Editor and i have added a toolsrtip control in the form with 7 buttons on it . The size (height) of the toolstrip control is very small. so the buttons on it appear very small. I want them larger(both by length and breadth) and by default the size of the toolstrip control cannot be changed form the Properties window. Please kindly tell me how to change the size.
Aniket Sonawane
|
|
|
|
|
hello frnds,
how can i convert word document to XML using vb.net the
if any one have code or supportive link then plzz..help
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032319980&CountryCode=US
Try this video.
|
|
|
|
|
Can any one plz help me to get the code for my problem.
problem:
I have to generate tables at runtime from Ms Access data base. Number of tables to generate depends on the sql query we pass in the program and the depends on the data in the tables.
So I want the code for diplaying a table on control panel and fill the data to it from the Access files based on the query.
Plz reply me if you got any ideas or codes for this
thank you
dil
|
|
|
|
|
I have to generate tables at runtime from Ms Access data base. Number of tables to generate depends on the sql query we pass in the program and the depends on the data in the tables.
>> User the "create table ... " query statement to create the table with number of columns and their types.
So I want the code for diplaying a table on control panel and fill the data to it from the Access files based on the query.
>>Do you have any file, which holds datas for newly creating tables?
Be simple and Be sample.
|
|
|
|
|
Thanks for favourable answer "ramskr".
I am trying to generate the grid view table on the control panel through for loop by using the sql query.
I got the code to get the data from the Access data base.
So the thing I need is, code to generate table at run time
Cheers.
dil
|
|
|
|
|
how to get the date format in vb?
Jayesh Talsaniya
|
|
|
|
|
Do you need to extract, month, day, year from date?
use -> Date.month , Date.day, Date.year. Also you can convert date to shortdate, shorttime, longdate and longtime as string.
Be simple and Be sample.
|
|
|
|
|
no i dont mean that.
i want to check the format fo the date that is in the textbox contol.
wether it is dd/mm/yyyy or /mm/dd/yyyy or other....
Jayesh Talsaniya
|
|
|
|
|
In VB.net there is no direct control to check format. Try with masked text box. You have to write own code on keypress event - first 2 digit should be below 12 (if it is month) and so on.
Be simple and Be sample.
|
|
|
|
|
oh is it so?
k thanx for replying.
now i wil code for that.
regards
Jayesh Talsaniya
|
|
|
|
|
Unless you limit the input of the user, there's no way to tell what format the date is in, reliably. Think about it. Which number is the month and which is the day in "6/6/07"? With restricting the user to a known format, it's impossible to tell. You could get a good clue if you looked at the culture information though. Chances are, the entered date will follow the standard format for a country. Mostly... Check out the CultureInfo class. You can get the current culture your code is running under and get the DateTimeFormat from there. This would be the culture of the O/S is setup for, NOT necessarily the one the user typed into a TextBox.
|
|
|
|
|
Hi,
I have a gridview of 5 columns.In that 3 column has radiobutton grouped in each row.
<asp:templatefield sortexpression="Item" headertext="Item">
<headerstyle width="15%" horizontalalign="Center" forecolor="White">
<itemstyle wrap="false" horizontalalign="Left">
<edititemtemplate>
<asp:textbox id="txtEditItem" visible="false" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Item")%>">
<itemtemplate>
<asp:label id="lblItem" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Item")%>">
<asp:templatefield sortexpression="Yes" headertext="Yes">
<headerstyle width="7%" horizontalalign="Center" forecolor="White">
<itemstyle horizontalalign="Center">
<itemtemplate>
<asp:radiobutton id="rbYes" runat="server" groupname="item1" checked="true" enabled="true">
<asp:templatefield sortexpression="No" headertext="No">
<headerstyle width="7%" horizontalalign="Center" forecolor="White">
<itemstyle horizontalalign="Center">
<itemtemplate>
<asp:radiobutton id="rbNo" causesvalidation="true" runat="server" groupname="item1" enabled="true">
<asp:templatefield sortexpression="NA" headertext="N/A">
<headerstyle width="7%" horizontalalign="Center" forecolor="White">
<itemstyle horizontalalign="Center">
<itemtemplate>
<asp:radiobutton id="rbNA" runat="server" groupname="item1" enabled="true">
<asp:templatefield sortexpression="Comments" headertext="Comments">
<headerstyle width="44%" horizontalalign="Center" forecolor="White">
<itemstyle wrap="false" horizontalalign="left">
<edititemtemplate>
<asp:textbox id="txtEditComments" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Comments")%>">
<itemtemplate>
<asp:label id="lblComments" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Comments")%>">
in this Button "rbYes" is checked by default. if i cliked "rbNo" or "rbNA" the other 2 columns must be editable.
Can anyone help me out in this..
expecting ur response..
Kanimozhi.S
|
|
|
|
|
Does this help any?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1727092&SiteID=1
|
|
|
|
|
HI ALL
CAN ANY ONE HELP ME WITH THIS....
I HAVE A DATAGRIDVIEW IN MY WINDOWS APPLICATION AND I POPULATE IT WITH DATA PROGRAMATICALLY.
BUT NOW I WANT TO PERFORM THE FOLLOWING OPERATIONS DIRECTLY ON MY DATAGRIDVIEW...
1. ADDING A NEW ROW TO DATAGRIDVIEW.
2. EDITING A ROW .
3. UPDATING THE EDITED ROW TO DATABASE.
4. DELETING A PARTICULAR ROW FROM THE DATAGRIDIEW.
ALL THESE OPERATIONS SHOULD REFLECT DIRECTLY IN THE DATABASE.
IF SOMEONE CAN HELP IT WILL BE APPRECIABLE.
THANKS.
|
|
|
|
|
In visual studio you can change the settings of grid view control by checking the edit, new check boxes.
First do that and find how the coding got changed in code behind.
I think based on that you can make the changes for your project.
Even I am new to VB.net, but I think it helps you.
dil
|
|
|
|
|
Hi
Thanks for ur coments i'll try it and let u know.
|
|
|
|
|
I am a beginner at this, so please talk in SIMPLE terms. I'm trying to create a program based off an Access table (actually four) that will control the project numbers, assemblies, product numbers, and product details. I have four listboxes, at the top of the form, that display each of the areas. Each of them has a go button under them. Below that I have some textboxes, that I would ilke to use for manual entry, and a GO button. Below all that I have a picture box, five text boxes, and a multi-line textbox that will contain the description. I'd like to have it where you click on the last go button (after all the information has been entered), the info shows up below. The hard parts will be the listboxes at the top and making the textboxes display the correct information. I need the project numbers in the first one, and so on. I can put the program (or what I have of it) on an FTP site if needbe, but due to the sensitive nature of the database tables I cannot publish them. Thank you for your time.
-----------------------------
If at first you don't succeed, use more duct tape, a bigger hammer, or just don't fail in the first place!
|
|
|
|
|
Hi everyone
I have the folowing code in the Business class in my program, but when i run it says that there's an error in the sql. Can you please help
Public Function AddSale(ByVal dtDate As DateTime, ByVal bookcode As String, ByVal InvoiceNo As String, ByVal qty As Integer, ByVal subtot As Single, ByVal vat As Single, ByVal tot As Single) As String
Dim sql As String
Dim cmd As OleDb.OleDbCommand
Dim result As String = ""
Try
sql = "INSERT INTO SALES (Dates, BookCode, InvoiceNumber, Quantity, SubTotal, VAT, Total) Values ( " + dtDate + " ,'" + bookcode + "','" + InvoiceNo + "', qty , subtot, vat, tot)"
cmd = New OleDb.OleDbCommand(sql, con)
cmd.Parameters.Add(New OleDb.OleDbParameter("@qty", qty))
cmd.Parameters.Add(New OleDb.OleDbParameter("@subtot", subtot))
cmd.Parameters.Add(New OleDb.OleDbParameter("@vat", vat))
cmd.Parameters.Add(New OleDb.OleDbParameter("@tot", tot))
cmd.Parameters.Add(New OleDb.OleDbParameter("@dtDate", dtDate))
If cmd.Connection.State = ConnectionState.Closed Then
cmd.Connection.Open()
End If
cmd.CommandText = sql
cmd.ExecuteNonQuery()
result = "true"
Catch ex As Exception
result = ex.Message.ToString()
End Try
Return result
End Function
|
|
|
|