|
Why not just use the listbox? is there some reason you dont want to use it?
|
|
|
|
|
Thank you Kevin,
Because I want a control that open a dropdown list when got the focus, and close it when lost the focus like a Combobox, but accepted more than one selection like a Listbox control.
|
|
|
|
|
Why not on the show the listbox when your textbox gets focus and hide the listbox when you textbox looses focus?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Thank you Steve Jowett,
OK. It is a good idea.
But I have a little problem. My experience in VS User Control construction is very poor. So I'm looking for something already done. A VB or C# User Control that I can downloaded and put in my forms.
Thanks
|
|
|
|
|
Hi to all,
I am trying to dynamically create label controls on TableLayoutPanel control, so that i have wrote following code. but at the debugging time it will genarate all the lables, but it doesnt show that panel as output. I checked its visible property its always false.... any body know why this happened?
Public Sub fillTablePanel(ByVal ds As DataSet, ByVal TableName As String)
FormContent.TablePanel.Parent = FormContent
FormContent.TablePanel.Visible = True
FormContent.TablePanel.BackColor = System.Drawing.SystemColors.ActiveCaptionText
FormContent.TablePanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.OutsetPartial
Dim tRows, tCols As Integer
FormContent.TablePanel.ColumnCount = ds.Tables(TableName).Columns.Count
For tCols = 0 To ds.Tables(TableName).Columns.Count - 1
FormContent.TablePanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100 / (ds.Tables(TableName).Columns.Count)))
Next
FormContent.TablePanel.RowCount = ds.Tables(TableName).Rows.Count
For tRows = 0 To ds.Tables(TableName).Rows.Count - 1
FormContent.TablePanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100 / (ds.Tables(TableName).Rows.Count)))
Next
ReDim FormContent.lblHeader(ds.Tables(TableName).Columns.Count)
For tCols = 0 To ds.Tables(TableName).Columns.Count - 1
FormContent.lblHeader(tCols) = New Label()
FormContent.TablePanel.Controls.Add(FormContent.lblHeader(tCols), tCols, 0)
FormContent.lblHeader(tCols).Text = Convert.ToString(ds.Tables(TableName).Columns.Item(tCols))
FormContent.lblHeader(tCols).Location = New Point(FormContent.TablePanel.Location.X, 10)
FormContent.lblHeader(tCols).Visible = True
FormContent.lblHeader(tCols).AutoSize = True
Next
FormContent.TablePanel.Location = New System.Drawing.Point(221, 46)
FormContent.TablePanel.Name = "TablePanel"
FormContent.TablePanel.RowCount = 2
Dim x As Integer = ds.Tables(TableName).Columns.Count
Dim y As Integer = ds.Tables(TableName).Rows.Count
ReDim FormContent.lblContent(x * y)
Dim ctr As Integer = 0
For tRows = 0 To ds.Tables(TableName).Rows.Count - 1
For tCols = 0 To ds.Tables(TableName).Columns.Count - 1
FormContent.lblContent(ctr) = New Label()
FormContent.TablePanel.Controls.Add(FormContent.lblContent(ctr), tCols, tRows)
FormContent.lblContent(ctr).Text = Convert.ToString(ds.Tables(TableName).Rows(tRows).Item(tCols))
FormContent.lblContent(ctr).Location = New Point(FormContent.TablePanel.Location.X, 100)
FormContent.lblContent(ctr).Visible = True
FormContent.lblContent(ctr).AutoSize = True
ctr += 1
Next
Next
FormContent.TablePanel.Size = New System.Drawing.Size(386, 93)
FormContent.TablePanel.TabIndex = 5
FormContent.TablePanel.Visible = True
End Sub
Pravin
|
|
|
|
|
I have only used the flowcontrol and in that case I created a user control for each set of data, placed all the management for the cotrol inside the user control and loaded 1 copy of the user control per record into the flowcontrol. That strategy may be relevant to the table control!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
please i have upgraded a .net project from 1.1 to 2.0 the application is running but the refences hold yelloe flags even i added them again and the application is generating an error while in debugging mode and working normally if i double click the .exe file.
Thanks
Mohammad Al Hoss
|
|
|
|
|
Could you post the debug information or errors that occur when you upgraded. Theoretically their shouldn't be too many problems.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
|
Kumaran21cen wrote: using C#.net.
Wrong forum.
If you are using Stream to save the file, then Stream.Length can solve the purpose.
|
|
|
|
|
I hav created a project in VB.Net where i have to create a setup wizard dat should work only for 30 days or 15 days what i am suppose to do. if the trial period get's over they should not be able to reinstall the setup again.in that particular pc any body help....
|
|
|
|
|
Hello all,I am wondering anyone can guide me how to read tiny text column for MySQL using VB.NET Datareader.
The following are the code I used to read the column:
Public Function StartupData(ByVal strKeySet as String)
Dim test as string
Dim MyTinyText as string
Try
ObjComm = New OdbcCommand("SELECT SettingValue FROM pos_setting WHERE LocationCode='KK' AND SettingKey='ADD_BINLOG'", ObjConn)
ObjConn.Open()
ObjRead = ObjComm.ExecuteReader()
If ObjRead.Read Then
test = ObjRead.Item(0)
MessageBox.Show("This is " & test & "")
Else
MessageBox.Show("No value")
End If
ObjConn.Close()
Catch ex As Exception
Finally
Objconn.Close
End Try
And my database table as follow:
---------------------------------------------
Field Type Collation Null Key Default Extra Privileges Comment
------------ ----------- ----------------- ------ ------ ------- ------ ------------------------------- -------
LocationCode varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
SettingKey varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
SettingValue tinytext latin1_swedish_ci YES (NULL) select,insert,update,references
I'm wondering why its keep showing there is no data read inside the datareader? Actually there is a '0' inside the SettingValue for that row of data but I'm wondering why it doesn't read it? Anyone can give me a solution for this?
Thanks for reading~!
modified on Wednesday, May 28, 2008 6:59 PM
|
|
|
|
|
Do you need the Not in If Not ObjRead.Read Then ?
If you are only wanting to get one value you could use objComm.ExecuteScalar() instead.
|
|
|
|
|
I'm sorry,I forgot to remove the not while testing it. Actually I want to check if the row exist in the database,then it will do something. But eventhough it exited this row but it doesn't run. Can anyone give me a solution how to check the tinytext content in MySQL database column? Am I used the right way?
Thank you~!
|
|
|
|
|
You can still do ExecuteScalar(). If no matching row is found nothing will be returned.
You might want to consider using the MySQL .Net Connector[^]. It has MySqlDbType.TinyText as a database type.
|
|
|
|
|
I am writing an email program, which will send mails to a number of email addresses in one go. But at the same time i want to save all the outgoing messages in my outlook express sent items folder. I am able to send mails in a loop but don't know how to save them in the Outlook Express Sent Items folder.
Is there any way to achieve the above functionality. Any code added will greatly help. I am using VB.Net 2005.
Thanks in advance.
Sekhar
|
|
|
|
|
As far as I know, this can be done through IMAP only.
Since, .NET inherently does not support IMAP so you might have to search for a third party tool to achieve the desired scenario.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
I'm having trouble keeping my forms looking the same, or at least similar, across different computers (different versions of Windows; different monitor displays, etc.) Would someone be willing to point me in the right direction to solve this problem?
Thanks
|
|
|
|
|
What exactly do you mean? If you're talking about the window "chrome" (title bar, maximize, minimize, restore buttons, toolbar colors, etc.) there isn't much you will be able to do about it with out a lot of work.
Toolbars (and menu bars, etc. -- basically anything that derives from ToolStrip) isn't bad depending on what you want to do, but requires creating your own ToolStrip Renderer class. For the rest of the window chrome you will need to hook various Windows messages (WM_xxx messages) to control painting the various client and non-client areas of the window. It's possible, but certainly not trivial.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
OK, sorry, I wasn't very clear. What I would like to do is to keep the button, textbox, and combobox controls in the same relative position to each other regardless of the exact size of the form as drawn in different instances of the program on different OS and display sizes. See for instance:
http://www.cstrader.com/Format.jpg[^]
Thanks
|
|
|
|
|
Ok...that clarifies things. The best way to achieve this is going to be through the use of panels and setting the Dock and/or Anchor properties of the panels and controls in those panels. Unfortunately there is no "magic formula" for how to set these properties, you will need to expirement until you get it right.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
What about dealing with variations in text size on different machines? In vb, controls were dimensioned in TWIPs, which were an annoying unit, but had the advantage that control sizes would scale proportional to font sizes. VB.net uses pixels to define control dimensions and placement. Unfortunately, if two systems use different numbers of pixels to display size-10 text, then text which fits in a button on one system may not fit in another.
|
|
|
|
|
.NET does use pixels, but all of the controls are based on a common font and point-size. That being said, there will be issues related to this particularly on machines with differnt DPI settings. You can change the AutoScaleMode property on the form, which will have some affect, but if you really want an application that will scale properly on any system/font/DPI you need to look at WPF.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Use the Anchor and Dock properties to set your form up so it resizes itself nicely for different resolutions.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Hi all,
I am using Name "xxx" As "zzz" to rename a file in vb6.My question is how can i rename a file in %systemroot%\inf folder ?What i mean is how to write the path string?
And other question is , is Name can be use for hidden file?If no, can you please suggest a way to rename hidde file?Thanks.
any tips are welcome
regards
cocoonwls
|
|
|
|