
Bucky
*Experts*
-
Posts
803 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Bucky
-
The Value and CustomFormat properties are not read-only, so you should not have a problem setting them. You will have to format the date to your custom format: StartTime.Value = Convert.ToDateTime(DateTime.Today.ToString("yyyy-M-d:HH:mm"))
-
To open the file in in the VS.NET XML editor, just select File -> Open -> File..., set the file type to "Data class files", and open the file. I found one small error in the file. You closed the </SpecialPriceFlag> tag, but you never opened it. Just add an opening <SpecialPriceFlag> and the value, and you should be all set. When you load the file into VS.NET and make this change, go to the XML menu, then Create Schema. An XSD will be created to match your file.
-
Your declaration for mycmd must be incorrect, then. It should be something like this: Dim mycmd As OleDbCommand = New OleDbCommand() In fact, to save a few lines of code, you could set the command's connection and command text right in its constructor: Dim mycmd As OleDbCommand = New OleDbCommand("UPDATE email SET name='" & value1 & "' WHERE name='perry' AND email='perry@hotmail.com'", mycn) If that does not solve your problem, then mycn must not be initialized. Either you didn't initialize it yet, or the initialization failed.
-
I have the Visual Basic .NET Bible, and it is a great resource for beginning VB.NET and learning all the new concepts. It only dabbles in other subjects of the .NET framework, though, so once you learn the new syntax and concepts in this bookyou may want to move into more goal-specific, language-neutral concepts the .NET framework provides, like Mutant mentioned.
-
too many files for openFileDialog (c#)
Bucky
replied to Juno's topic in Directory / File IO / Registry
Well you're clearly not going to able to reach your goal with the OpenFileDialog control (Hey, that rhymes!). If you have VB6, you could create an ActiveX control that uses the FileListBox, DriveListBox, and DirListBox to select your files. Or you could just create your own form in C# that populates listboxes with directories and files using classes found in the System.IO napespace. Other than that, I don't know what to say. If you can find or create an alternate open file dialog that doesn't rely on the Windows Common Dialog control, then all the more power to you. -
When you build the project and that error is displayed in the task list, double-click it. A window pops up, and you can select your form as the startup object there. Rebuild the project and you should be all set; you won't need the Sub Main any more.
-
Er, that is partially correct. You need to create a new variable to hold a new instance of the form, and then show the form using Application.Run() (only in Sub Main, that is). Public Shared Sub Main() Dim frm1 As New Form1() ' A new instance of Form 1 Dim sTest As String Application.Run(frm1) ' The code stays here until frm1 is closed sTest = frm1.TextBox1.Text End Sub ' Now the program ends
-
I don't know any SQL, but from the looks of your command the variable value1 needs to be outside the string so it is added to the command as "newname" rather than "value1": mycmd.CommandText = "UPDATE email SET name=" & value1 & " WHERE name='perry' AND email='perry@hotmail.com')"
-
Anything that implements the IEnumerable interface can be set to the DataSource of a grid. The SqlDataReader class does this, so you should have no problem setting it to the DataSource.
-
In the Form1 class, create the following Main method to run the program: Public Shared Sub Main() Application.Run(New Form1()) End Sub [edit]Fixed, thanks Volte, I knew I was forgetting SOME modifier...[/edit]
-
If you want to use your own file format of some sort to save and load the picture and text, create a class that contains an Image property and a Text property. Make a new instance of the class, set the properties to the Picturebox's picture and the RichTextBox's text, and then save the class using classes in the Serialization namespace. You can then also load files into this class and then set the text and pictures on the MDI form easily. If you're new to serialization, read up on it [mshelp=ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconserialization.htm]here[/mshelp]
-
This piece of code should work fine: If txtDescription.Text.IndexOf(Environment.NewLine) = -1 Then ' There are NO newline characters Else ' There ARE newline character(s) End If
-
too many files for openFileDialog (c#)
Bucky
replied to Juno's topic in Directory / File IO / Registry
You could require that the files all be placed in the same directory, and use the Browse for Folder dialog class from EliteVB to select that foder. -
In the .NET Framework, if you were just looking to store data for your application without having to transfer it between different mediums, you could use serialization to save and load a class in XML (using the SoapFormatter), or in the much more compact binary (using the aptly-named BinaryFormatter), to go between a saved file and a class instance in only a few (say 2 or 3) lines of code. It's insanely easy and very powerful.
-
too many files for openFileDialog (c#)
Bucky
replied to Juno's topic in Directory / File IO / Registry
I've never heard of having that problem before. The best bet would be to pop a message box to the user informing them that they selected too many files, and also telling them to select less next time. Then re-open the dialog box so they can try again. -
One option might be this, to fake ASP.NET out and close the table data tag yourself to keep the checkbox in its own column. I'm not sure if or how well this will work, but try setting DataTextFormatString to "</td><td>{0}".
-
All you need to do is declare a new Label class in code, set its properties to make it look right, and then add it to the form's Controls collection. You'll need to do some math to correctly place the labels and checkboxes. ' Declare the new label Dim newLabel As New Label() ' Set its properties (these are just examples) With newLabel .Text = "Title one" .Font.Bold = True .Location = New Point(8, 8) .Size = New Size(80, 8) End With ' Add it to the form Me.Controls.Add(newLabel)
-
Funny, I was just thinking about this topic when I read a recent article in Popular Science about the creator of X-Plane. http://www.popsci.com/popsci/aviation/article/0,12543,463052,00.html Talk about a perfect combination of motivation and obsession. He has my dream job.
-
The Keys enumeration is in the System.Windows.Forms namespace. Make sure that the namespace is imported in your code file and that your project referenced that DLL.
-
Most likely not... all the ASP.NET processing (except for Postback and other VBScript of JavaScript functions) is done server-side. Since how the table is viewed is determined by the client application (the web browser visiting the page), there's no way for the server to know how the table is going to look. In summary, unless this is possible in JavaScript or VBScript, I'd say there's little chance of it happening.
-
Not necessarily... You could use a Session variable to store a user's logged-in ID instead of a QueryString (which they could easily change), but use QueryStrings if you just want to pass parameters to a page on how to sort data (so that when the URL was copied and pasted, the sorting would be sustained). Also keep in mind that Session variables are stored on the server, and a whole bunch of them could take a toll on the server's memory. Don't forget about cookies for storing data, too.
-
You need to place an OpenFileDialog component on your form. Go to the form design view and create one from the toolbox.
-
I've thought of an easier solution: XML serialization. It does all of the reading and writing formatting for you, and you can access all the values as the properties of a class. [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconintroducingxmlserialization.htm[/mshelp] It's something to consider. :) As for your question, there is a ton of code and explanations in MSDN. Read it through and you should have a good idea. There are links [mshelp=ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconxmldocumentobjectmodeldom.htm]here[/mshelp] regarding reading and writing files with the XmlReader and XmlWriter.
-
MouseLeave doesn't fire when form moves on LinkLabel click
Bucky
replied to Bucky
's topic in Windows Forms
Ah, I solved the problem with props to VolteFace. For some reason, setting ShowInTaskar to false directly before or after minimizing the form screws up those events. I had completely overlooked the use of Show() and Hide() instead, and they work perfectly. -
I've created a custom control that inherits the LinkLabel control and adds some properties and painting routines. It also responds to the MouseEnter and MouseLeave events of the base control. When the control is used to move the form somewhere else or to minimize the form the MouseLeave event never fires, and then when the form is restored and other controls are hovered over, THEIR MouseLeave events never fire. For every control that becomes "stuck" like this, the MouseEnter event also does not fire. I tried calling MyBase.OnMouseLeave to artifically combat it, but no luck; the control is still waiting for the mouse to officially leave. How can I get the MouseLeave event to fire correctly?