|
You don't have to redo the entire control, just the drawing part. The ListBox class exposes properties and events that you supply the code for to custom draw the listbox. Check this[^] out for an example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a MainForm (MDIParent), a ChildA form and a Child1OfChildA Form. I have a Panel control on ChildA Form, How can i place Child1OfChildA on this panel controll on ChildA from? and how can i show it with a tab control?
Thanks
|
|
|
|
|
A couple of things...
First, you can't add an MDIChild form to another control. It'll only work inside an MDIParent form, in its MDIClient control, which is hidden, but plainly obvious on your MDIParent form. THe MDIClient control is docked to take up the entire unused area of an MDIParent form. You can get a reference to the MDIClient control in the MDIParent form using:
Dim mdiClient As MDIClient
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is MDIClient Then
mdiClient = ctrl
Exit For
End If
Next
If mdiClient Is Nothing Then
Throw New Exception("MDIClient control not found!")
End If
Don't get any cute ideas, there can only be one MDIClient control on a form. You can get more information on it here[^], but it's not very well documented. Also, Windows does NOT support a window being both an MDIParent AND an MDIChild, so you can NOT create a form that is both and nest as many MDIChild forms as you want inside each other.
You CAN, however, treat a form as a control! Ever notice that the Form class inherits from the Control class? Well, in .NET 1.0 and 1.1, it inherits from Control. In .NET 2.0 it inherits from ContainerControl, which eventually inherits from Control, and so does any Windows Forms control, like Button or Label or TextBox. Hmmmm... How could you get a Form to behave like any other Control?
It's not as simple as adding it to another forms Controls collection, but it's very close! Click here[^] for the answer.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 16:14 Wednesday 15th February, 2006
|
|
|
|
|
RageInTheMachine9532
Thank you for your response, i really appriceate it and thank you for the links.
|
|
|
|
|
In my Reports I use ListViewControl. I wantto fill Listview Asynchronly,and use all of its properties , how could i do this?
:-> ^);P;)
'Delegate Sub AddItemsDelegate(ByVal Item As ListViewItem)
'Private Sub AddItems(ByVal Item As ListViewItem)
' If lvCekler.InvokeRequired Then
' Dim d As New AddItemsDelegate(AddressOf AddItems)
' Me.Invoke(d, Item)
' Else
' lvCekler.Items.Add(Item)
' End If
'End Sub
|
|
|
|
|
Hi.
I've a form with 12 TextBoxes. It names are:
pred1
pred2
...
pred12
How can I add counter number to Names in For...Next cycle?
( for i=1 to 12
something=pred {<- i} (?)
next i)
Best regards,
Konstantin
|
|
|
|
|
have you ever heard CONTROLS Collection ?
|
|
|
|
|
...yeah. so what?
i'm writing macros in excel. is it possible to use it there?
Best regards,
Konstantin
-- modified at 9:47 Wednesday 15th February, 2006
|
|
|
|
|
all textboxes are in PANEL named pnlTextBoxes
dim txt as Syetm.Windows.Forms.Textbox<br />
For each txt in pnlTextBoxes.controls<br />
SomeThing=txt.AnyPropery<br />
Next
|
|
|
|
|
In VBA there is no a lot of objects.....such as pnlTextBoxes, controls and other...
Best regards,
Konstantin
|
|
|
|
|
Hi all,
We want to start a VB6 windows app from a windows service in VB.NET 2003. After installing the windows service, it starts the app as a "process" (we can see it in the task manager) and we cannot see the form, so we couldn´t inertact with it.
How we can make to start normally this window app?
Thanks in advance...
Time flies like an arrow
-- modified at 9:57 Wednesday 15th February, 2006
|
|
|
|
|
The service which starts the app has to have the "allow interact with desktop" flag set in order to be able to propagate this to any application started by it and in order to show up with a form or sth similar.
The other method would be to you start the application in the context of a user instead of the system, which has the benefit that the program does not run in the system context (with even more that administrative rights) but only in the limited user context.
All Settings to be made in Administrative Tools/Computer Management/Services.
|
|
|
|
|
thanks!!!!
-- modified at 15:39 Wednesday 15th February, 2006
|
|
|
|
|
I'll say this one more time, because no matter how many times you ask the question, the answer doesn't change!
It's a CUSTOM BUTTON implementation! You can find such an example right here[^]!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave is right.
The standard button control won't show an icon when FlatStyle=System.
Your only choices are to:
A) Change FlatStyle back to Standard.
B) Use a custom button control, like the one Dave linked to.
|
|
|
|
|
I need to retvieve report from 2 tables which have same values in field of one
table. 2 of the tables dont have primary key.I need to retrieve depending on month. plz help me(In cystal reports using vb.net)
|
|
|
|
|
I have a number of experience on using 2 dimension array in VB.NET,
I would like to know some better, and standard pattern to write it.
for an example,
We need to pass a set of patient record from a modules to a form,
this record include all the current male patients(no fixed length).
the record includes (name, sex, age)
Please give me advise and write down your coding style in this issue.
Thanks!!
|
|
|
|
|
I wouldn't use arrays at all.
Make a class with the properties for a patient. Create objects from the class and put the objects in a list, for an example an ArrayList.
---
b { font-weight: normal; }
|
|
|
|
|
I'll second the other reply and extend it a bit.
1) Create a Patient Class including all the attributes for the patient (name, gender, age, et al.)
2) Create a PatientCollection class, inheriting from CollectionBase (see Walkthroughs in help for
details on how to do this)
The Patient class is a gimme. It is pretty much a canonical example of a class/object to be used in a program.
The PatientCollection is a bit more work than the ArrayList but is safer and since you have Option Strict turned on (hint, hint) it will save some casting in your code.
hth
Alan.
|
|
|
|
|
How can I auto-populate two MS Word document fields (customer name) and (address)
From the Northwind database
Example:
MS Word Document: New customer Information
This is to inform you Mr. _________(customer name) has a new address of _______ (address)
Here is my scenario:
User logs in to web page and updates a record for the customer’s new address, which will be stored in the customers table of the Northwind database. User wants to print the above word document: New Customer Information which will contain the updated data
I have visual studio 2003, and Visual studio tools for office
|
|
|
|
|
hi
i want to know how to crete table through quries in access
i had created table test1 with one field id which is autonumber i had used following code
strSql = "Create Table test1(Id AutoNumber)"
conn.Execute strSql
but it gives error syntax error in field definition
what i want is that id should be primary key and autonumber
ddd
-- modified at 2:08 Wednesday 15th February, 2006
|
|
|
|
|
The autonumber column type in Access is called "INTEGER IDENTITY". Also, you must set the primary key.
Here's an example:
strSql = "CREATE TABLE test1 (" & _
"id INTEGER IDENTITY NOT NULL, " & _
"CONSTRAINT PrimaryKey PRIMARY KEY (id))"
conn.Execute strSql, , adCmdText + adExecuteNoRecords
|
|
|
|
|
|
Hi, I am using VB.NET 2003/MS Access. I am getting data from a table into a particular datatable in a dataset. say the data fields are ID, Name, Period and Address. I want to obtain a record from the table for a particular period and ID. How can this be done using a select statement?
With Best Regards,
Mayur
|
|
|
|
|
SELECT * FROM TableName WHERE [ID]=@ID AND Period=@Period
!alien!
|
|
|
|