|
I am developing the windows application
In that i used the TabControl
In that Tabcontrol on one tabpage i choose DOB when user selects the DOB
then on another tab in the textbox age is calculated accordingly
Please Suggest.....
|
|
|
|
|
Arr You Using VB6 or Visual Basic .net
but in both cases there is only a single form so no matter you are working on which ever tab of tab control you could use the datetimepicker's value change to calculate the age. and store into the textbox you required.
With Regards
Yogesh Agarwal
modified on Friday, February 29, 2008 5:45 AM
|
|
|
|
|
hi all,
currently i am working on desktop application in vb.net, and facing problem to handle two form at the same time.
like i want to input some values on form1 say textbox1.text=500 and textbox2.text=600
now i want to show another form and also want to input some values like
textbox3.text=600
i declared a public variable like public var1 as double on form2
now i want to use this variable on form1
thanks in advance
rmshah
Developer
|
|
|
|
|
Hi
You could use the code like this.
<br />
form1.textbox3.text=form2.textbox1.text<br />
form1.show<br />
Here i assume that form1 is the object for form1 but there i sno requirement to use form2 here i just use it to make understandable.
Or you could create the static public variable so that you could use it directly without static you have to call using obj name and new object will distroy the value you store in you public variable so use static variable concept
Hope the solution will help you
With Regards
Yogesh Agarwal
|
|
|
|
|
One simple way to implement it is like a folder browser dialog. You can pass in the initial folder to the dialog via the exposed Path property, the dialog will be defaulted with the folder when shown, the user can select another folder, then click OK. The system reads the DialogResult.OK result, and get the user selected folder via Path. If the result is DialogResult.Cancel, ignore the result.
|
|
|
|
|
Try this example:
No need to change any control properties in this example. Coding follows after the explanation.
Create a new solution with 2 forms, Form1.vb and Form2.vb.
Create a text box and a button on Form1.
Create a text box on Form2.
On the code view for Form1.vb, create code for a public share textbox. In the load function, assign the public share to TextBox1. Create code for Button1 click event to open Form2.vb.
On the code view for Form2.vb, create code in the ChangeText event of TextBox1 to access the shared textbox control from Form1.vb.
Compile and DeBug.
Click on Button1 to open Form2
Type text into TextBox1 on Form2 and it will automatically show in TextBox1 on Form1. No other variables to hold data are necessary. After closing Form2, data can be processed on Form1 as needed.
Below is the code (name your variables appropriately):
***Form1.vb************************************
Public Shared tb1 As TextBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
tb1 = TextBox1
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim newForm = New Form2()
newForm.show()
End Sub
***Form2.vb*************************************
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Form1.tb1.Text = TextBox1.Text
End Sub
************************************************
************************************************
To use this method, the shared controls need to be in the first form opened (not necessarily the first form in your program) and accessed by the second form. The shared controls need to be initiated and assigned values before the they can be used by another form.
This method can be used for any type of control you want accessed by another form.
I use this type of setup in most of my programs. Easier than keeping track of too many public variables, especially in programs with a lot of forms that require user input. You will need to experiment to see how to use this in your forms.
|
|
|
|
|
Hi there,
I was wondering if anyone was able to send a web request successfully to a lighttpd server. I am using RoR on the lighttpd side and when I send a request, I want the RoR code to save the request. If you're familiar with RoR, the code works fine in WEBrick. Is there something I'm missing? The final solution I would like is the .net app to communicate with the https portion of lighttpd.
RoR code:
def foo
if @testhash == params[:check]
@r= Timecard.new
@r.people_id = params[:id]
@r.card_id = params[:cd]
@r.day_in = checkinday
@r.time_in = checkin
@r.save
end
end
VB.net
Dim request As HttpWebRequest
System.Net.ServicePointManager.CertificatePolicy = New MyPolicy
request = CType(WebRequest.Create("http://127.0.0.1:3000/people/foo?"), HttpWebRequest)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = data.Length
request.Method = "POST"
request.AllowAutoRedirect = False
Dim requestStream As IO.Stream = request.GetRequestStream()
Dim postBytes As Byte() = Encoding.ASCII.GetBytes(data)
requestStream.Write(postBytes, 0, postBytes.Length)
requestStream.Flush()
requestStream.Close()
Thanks for your help everyone.
d
|
|
|
|
|
hi guys, i am using menu strip 2 in my vb.net application, in the image property i set image , but it is not shown clearly , the size of the image is reduced and its appearance gets dull,,
can u tell me how to i show image in the munuetrip so that it persist its appearance in the menustrip....
hello
|
|
|
|
|
menu strip requires image of 16 x 16, if image is greater or less than 16 x 16 then it get resize
so make an image of 16 x 16 and then put it in MS
hope it will help
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
I have a datatable retrieve data in a datagrid with a checkbox column bounded to it.
On the 1st data retrieval on datagrid, I'm able to check the checkbox.
But if i click search to have 2nd data retrieval on datagrind, I'm unable to check the checkbox.
Below is my code, i hope someone can guide me to solve this.
Private selectedRows As ArrayList
Private Sub dgResult_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim hit As DataGrid.HitTestInfo = dgResult.HitTest(e.X, e.Y)
If hit.Column = 0 AndAlso hit.Type = DataGrid.HitTestType.Cell Then
dgResult(hit.Row, hit.Column) = Not CBool(dgResult(hit.Row, hit.Column))
If CBool(dgResult(hit.Row, hit.Column)) Then
selectedRows.Add(hit.Row)
dgResult.[Select](hit.Row)
Else
selectedRows.Remove(hit.Row)
End If
End If
End Sub
I did run step by step to check the error. When the 2nd retrieval, it run through the codes twice.
1st, it run
Private Sub dgResult_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
If hit.Column = 0 AndAlso hit.Type = DataGrid.HitTestType.Cell Then
dgResult(hit.Row, hit.Column) = Not CBool(dgResult(hit.Row, hit.Column))
If CBool(dgResult(hit.Row, hit.Column)) Then
selectedRows.Add(hit.Row)
dgResult.[Select](hit.Row)
end if
end sub
then continue to run it again but this time to remove the check.
Private Sub dgResult_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
If hit.Column = 0 AndAlso hit.Type = DataGrid.HitTestType.Cell Then
dgResult(hit.Row, hit.Column) = Not CBool(dgResult(hit.Row, hit.Column))
If CBool(dgResult(hit.Row, hit.Column)) Then
selectedRows.Remove(hit.Row)
end if
end sub
So, it seems i cannot check.
But in actual, it added the check and removed the check at the same time.
Can anyone help me? Thanks.
eunice
|
|
|
|
|
Hello every one,
I have an application in which I am taking input form a tablet and using it to draw image on screen (Almost like MS Paint, just the input is coming from tablet instead from mouse).
Till now I was saving this as image file.
Now I want to store the image in a PostgresSQL database
These are my doubts I need some help on..
1 Is it possible to store all the points which I am getting as lorge object in DB, instead of whole image? I was thinking that if I do it then I may be in a position to save at least the memory used to store the background of image…
2 If so then how do I do that… create a structure array or something and store points with line width and color… or there is any other way
3 What will be the table structure in the either possibility? Any relevant VB.net example will be really of a great help.
Regards
Nishkarsh
|
|
|
|
|
1 - yes, you can store any format you like
2 - as the number of points will be arbitrary, I'd store it as XML in one field.
3 - storing an image is easy, it's one column. Storing points means you don't know how many points will be in one image, so I'd store them all in one column still
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can you please give me any sample code to insert... I am having issues with it..
The code i am using is as follows
Dim inputFileStream As New FileStream("C:\test.gif", FileMode.Open, FileAccess.Read)
Dim reader As New BinaryReader(inputFileStream)
Dim bytes() As Byte
bytes = reader.ReadBytes(CInt(inputFileStream.Length))
inputFileStream.Close()
Dim Sql As String = "INSERT INTO im_prescription_image (st_image_name,im_image) VALUES (?,?)"
Dim Cmd As New Npgsql.NpgsqlCommand(Sql, cnn)
Cmd.Parameters.Add("@st_image_name", NpgsqlTypes.NpgsqlDbType.Varchar).Value = "as10000000000000"
Cmd.Parameters.Add("@im_image", bytes)
'cnn.Open()
Cmd.ExecuteNonQuery()
cnn.Close()
I am grtting the following error
Npgsql.NpgsqlException was unhandled
BaseMessage="syntax error at or near ",""
Code="42601"
Detail=""
ErrorSql="INSERT INTO im_prescription_image (st_image_name,im_image) VALUES (?,?)"
File="scan.l"
Hint=""
|
|
|
|
|
I'm not sure about the format you're using, I'd do this with a stored proc.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is my first post on this site. Im a new VB.Net programer that has been tasked with writing a app to dial a BBS, Navigate the menu system and then upload a file using X,Y, or Z modem.....
Most all my experience has had to deal with database, and file parsing and I am swimming in deap water here. I have looked around online nad not found a good How TO aritcle on this type of thing. I know BBS is from a by-gone era, but my company has to deal with this sort of thing a lot. Currently they use Expect script and Unix Shell scripting to domost of this sort of thing, but by dept. wants to do it in VB.net from a windows box.
can anyone out there help or point me to some good resources on this sort of thing.
Thanks in advance...
|
|
|
|
|
Why do they want that ? Surely there are free programs to do that, I thought one came with Windows ? It used to.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Not that I am aware of...
The reason I need this is because I have been tasked with creating an application the would connect to a State run BBS and upload a file to them, then download a response file from them. This application would have to navigate through the menu options to get to the correct location before uploading.
If you know of some app that came with or comes with Windows..... let em know.
|
|
|
|
|
I have a MS-Access table is bound to a datagridview that I need to do is programatically add rows based on input from the user. Below is a section of the code that I'm using to accomplish this. When the AcceptChanges statement is executed, the "System.Data.RowNotInTableException" error is thrown.
How can I add data to this bound table?
schedRow = CType(CType(Me.PP_ScheduleBindingSource.AddNew, DataRowView).Row, TCDataSet._PP_ScheduleRow)<br />
<br />
schedRow.SchedDate = dTmp<br />
schedRow.SiteID = Me.ComboBox1.SelectedValue<br />
schedRow.EmpID = clbTemp.CheckedItems.Item(j).ToString<br />
schedRow.TimeOpen = sOpenTime<br />
schedRow.TimeClose = sCloseTime<br />
<br />
schedRow.AcceptChanges()
|
|
|
|
|
Your problem is that you're calling AcceptChanges() . I suggest reading the documentation on that method. It doesn't do what you think it does.
AcceptChanges tells the dataset/datatable that it should set the status of every row in the set/table to Unchanged. This means that there is no longer any Added, Modified, or Deleted rows in the set/table. So when you finally call Update to write the changes back to the database, there are no changes to write back since every row is now tagged Unchanged.
You CAN call this on individual rows, though, in your sample code, this is not necessary.
The bottom line is the exception is thrown because you created a new row, but you didn't add it to a table. Then you called AcceptChanges on that row. You do not need to AcceptChanges at all. Remove the AcceptChanges line and add the code to add the new row to the target tables Rows collection.
|
|
|
|
|
It appears that the following code snipet sucessfully adds a row to the database. This allows me to programatically add rows to a table that is bound to a datagridview on my form.
This is exactly what I needed to do! Thank you very much.
Dim schedDR As TCDataSet._PP_ScheduleRow<br />
<br />
schedDR = CType(CType(Me.PP_ScheduleBindingSource.AddNew, DataRowView).Row, TCDataSet._PP_ScheduleRow)<br />
<br />
schedDR.SchedDate = "2/29/2008"<br />
schedDR.SiteID = "ACME"<br />
schedDR.EmpID = "1234"<br />
schedDR.TimeOpen = "9:00 AM"<br />
schedDR.TimeClose = "5:00 PM"<br />
<br />
Me.PP_ScheduleBindingSource.EndEdit()<br />
Me.PP_ScheduleTableAdapter.Update(Me.TCDataSet._PP_Schedule)<br />
|
|
|
|
|
Hi there,
i am currently implementing a windows service that needs to encrypt some data using X509 certificates. The user shall be able to select the certificate in the configuration GUI of the service. As the GUI runs as the current user and the service runs as local system, they obviously can´t access the same certificate stores.
I want to present the user a collection of certificate stores that the local system user is able to access. Is there any way to access the certificates of another user?
Any help would be appreciated, thanks in advance.
Sascha
|
|
|
|
|
This might work, but you'd have to have code in your service to impersonate the user and load their profile in order to get access to their certificate store. Loading another users profile can take a VERY long time.
I've never done this, so I don't have any example code. The best I've got to give is this[^].
|
|
|
|
|
Sorry to be dense, but what is the control that looks something like this, with two columns, 1 for the variable and 1 for the data. I see it a lot. Is this a datagridview?
Thanks
+ Box1 (can be maximized or minimized to show
Item 1 | Item1 value (might be dropdown, etc.)
Item 2 | Item2 value
- Box2 (minimized
+ Box3 (maximized)
Item 1 | Item1 value (might be colordialog, etc.)
Item 2 | Item2 value
|
|
|
|
|
try TreeView
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
No, I don't think it's a treeview.
You can see an image here: www.cstrader.com/image1.png
|
|
|
|