|
I have hierarchical data that the user can make one of four choices about. The primary treeview manages @900 rows of data that collapsed to @100 groups.
I need to draw a tree view with a 'radio button group' where the radio buttons are related to the treeview node index.
I have made a User Control for the 4 radio button but can't quite figure out:
1) How to Position the radiobuttons to align with the tree view node
2) Linkage to connect the button data to the treeview node
i.e.
[a,b,c,d] tvNode1
[a,b,c,d] tvNode2
Each control is located on separate panels, panel 1 is for the radio buttons, panel 2 is for the Treeview. - Is there may be a better way???
TIA
Tom Hamilton
Sacramento, CA
|
|
|
|
|
I would start from an existing treeview control and set the the DrawMode-property to OwnerDrawAll, so you you don't have to bother about the complexicity of the positions. In this mode you can draw your buttons instead of the existing signs in the treeview. Does this help your problem?
|
|
|
|
|
In vb.net 2005.
I am wanting to say at form load that if a global value (strName) has not been used (i.e. has not been entered into), then load another form, how can i do this, i have tried:
If strName.length < 1
strName.Empty
Help!!!
|
|
|
|
|
better delete this one...you'll get yelled at for double posting
|
|
|
|
|
try this Code
If strName= Nothing Then
else
End If
|
|
|
|
|
Sorted now cheers
|
|
|
|
|
In vb.net 2005.
I am wanting to say at form load that if a global value (strName) has not been used (i.e. has not been entered into), then load another form, how can i do this, i have tried:
If strName.length < 1
strName.Empty
Help!!!
|
|
|
|
|
Public Class Common
public shared strName as string = String.Empty
End Class
Public Class Form1
private sub form_load(....)
if common.strname = string.empty then
common.strname = "hello"
End if
End Sub
End Class
|
|
|
|
|
I want to clarify what you are asking? Are you trying too check the value of a textbox control to see if it is null and if so then opening a different form? Or are checking to see if a control has been createded?
Jhoga
|
|
|
|
|
Im trying something like this:
If strName.IsNullOrEmpty Then frmTeachBasics.Show()
The strName is a global, but it is coming up with an error asking me to replace "strName with String"
|
|
|
|
|
Try If String.IsNullOrEmpty(strName) Then frmTeachBasics.Show
|
|
|
|
|
i have two forms , form 1 and form 2
if have given some value in textbox1 of form1, i want the same value to be displayed on label of form2...
please help..
thanks
|
|
|
|
|
you can pass the pointer of the label of form1 to form2 and have it update in the textchange event or leave event.
|
|
|
|
|
You should NEVER pass a reference to a control between forms. You can pass the string to form2, via a property, store the value in a common property in a static class, or use a delegate to inform form2 when it changes in form1, if form2 is modeless.
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 )
|
|
|
|
|
im creating a form where users can login to a seperate form using a login name and password. I'm trying to compare the users imput for the login to a feild in MS Access and the same with password input in a seperate feild in the same table(PCBank.mdb). if input is correct go to form2.
if anyone can help it would be greatly appreciated. code below is my attempt
Imports System.Data.OleDb
Public Class Form1
Dim conn As OleDbConnection
Dim comm As OleDbCommand
Dim dr As OleDbDataReader
Dim da As OleDbDataAdapter
Private Sub connect()
conn = New OleDbConnection
conn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=|datadirectory|\PCBank.mdb"
conn.Open()
comm = New OleDbCommand
comm.Connection = conn
comm.CommandType = CommandType.Text
End Sub
Private Sub DisplayRecord()
Me.txtid.Text = dr.GetString(0)
Me.txtpass.Text = dr.GetString(1)
End Sub
Private Sub btnlogin_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
connect()
comm.CommandText = "select * from Managers where id like '" & txtid.Text & txtpass.Text & "%'"
If txtid.Text = "Managers" = dr.GetString(0) And txtpass.Text = "Managers" = dr.GetString(1) Then
My.Forms.Form2.Show()
Me.Close()
End If
End Sub
End Class
|
|
|
|
|
in my form i hv strDbDate as string which ic coming from txt file and in database it is stored in varchar2 format
eg strDbDate = 20070212 which is in format yyyymmdd
now i want to check dis date is valid or not
Public Function CheckDate(ByVal strDate As String) As Boolean
Dim formatNew As New CultureInfo("en-GB")
Dim sDate As Date
Try
If sDate = DateTime.ParseExact(strDate, "yyyyMMdd", formatNew) Then
Return True
Else
Return False
End If
Catch ex As System.Exception
RemarksLabelUC1.RemarksText = "Invalid date format"
Return False
End Try
End Function
if anybody knows plzzz reply ASAP
thnxs
|
|
|
|
|
You can also use the IsDate function. I think you'd first have to reorganize the string to this format first MM/dd/yy and then you can say:
If IsDate(strDbDate) Then<br />
Return True<br />
Else<br />
Return False<br />
End If
|
|
|
|
|
Why not just do this:
Return IsDate(strDbDate)
But, the problem with IsDate is that it won't let you specify a format for the date string, which if read one way is perfectly legal, but if it's not system default format, isn't legal.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Pushpa Setty wrote: If sDate = DateTime.ParseExact(strDate, "yyyyMMdd", formatNew) Then
This won't work as, unlike C++ or C#, you're not assigning anything to sDate. You're actually comparing a date object (Jan 1, 0001) to the date object returned by the DateTime.Parse, which will, in all likelyhood, be false every single time.
It should work, and be a little more flexible, if you did something like:
Public Shared Function CheckDateFormat(ByVal dateToCheck As String, ByVal culture As CultureInfo) As Boolean
Try
DateTime.ParseExact(dateToCheck, "yyyyMMdd", culture)
Return True
Catch
' Your function shouldn't care about other controls on the form.
' It's up to the caller to decide what should be done, like post a message,
' when this function returns False.
Return False
End Try
End Function
Mind you, this will only check to see if the date is legal on the Gregorian Calendar. It won't check to see if the date is within a legal range for your applications data.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
function which will clear all controls in the form when it is called. appreciated for ur help.thank u
|
|
|
|
|
Hi
You Must Write The Function Yourself.
For Example I Have 2 TextBox;2 CheckBox&....
I Write a Sub or function Such This:
Sub ClearMyForm()
Text1.text=Dafault Text1
Text2.text=Dafault Text2
Checkbox1.Value=0 'Default Is UnChecked
checkbox2.value=1 'Default Is Checked
.
.
.
End Sub
Good Luck.
Mogtabam
|
|
|
|
|
Use control collection...
For Each ctl As Control In Me.Controls
ctl.text="" '''''''''get each control one by one
Next
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
when a row is double clicked in datagrid ,the row data should display in textboxes(VB.NET).waiting for help.
thank u
|
|
|
|
|
If you are using a datagridview here's an example:
txtAC.Text = DataGridView1.CurrentRow.Cells(9).Value & " "
PUT THIS IN THE DATAGRIDVIEW CLICK EVENT.
jhoga
|
|
|
|