|
Hi,
I haven't come across anything like that.
Alan
|
|
|
|
|
Just tested the VB.NET code. As Alan states, there's a translation error from C# to VB.NET here:
'This procedure will open the media file
Private Sub OpenMediaFile()
ClosePlayer()
Dim PlayCommand As String = "open """ + GetFileName + """ type mpegvideo alias MediaFile"
mciSendString(PlayCommand, Nothing, 0, IntPtr.Zero)
isOpen = True
End Sub
Enjoy
I are troll
|
|
|
|
|
Hi. First off I apologize if I'm posting this in the wrong forum, this is my first time posting here. I'm working on a project and a segment of the project deals with random stat (stat as in rpg stats) generator and I've encountered a bit of a problem. The program, which we'll call Character Creator for now, offers the user three ways to generate six stats. Rather than posting all of the code (which is about 750 pertinent lines) I'll describe how the first method works. This method is the equivalent of adding the result of four six-sided dice, re-rolling on ones, and dropping the lowest number.
Here is a screen shot of the design view of my program[^]
This image shows how the check boxes allow the user to assign a single stat to each number[^]
Because of how time consuming it took to make just one generator on the form, I made it into a user control so I could simply drag and drop it onto the form three times, thus giving the user the ability to select from one of three different sets of numbers to work with. This is where the problem comes in. My problem is that I don't know how to access the text boxes or check boxes in the control or is such a thing is possible. For example, this what I first tried to see if I could still access components and variables of the control:
'genOne is the name of the first generator
'txtStatOne is the name for the first text box in the column
'statOne is the name of the random variable
genOne.txtStatOne.text = statOne
I need to do this because after the set of numbers is selected and assigned to a stat, it will be sent to be stored in a database along with other pieces of information. This part has yet to be implemented so on the form there will be a "Finish" button that sends all entered information to a database. Any help is much appreciated.
|
|
|
|
|
First, I think the UI you've come up with is confusing, but hey, it's your app.
Next, you had the right idea putting this in a User Control. The problem is you have to write some code in the User Control to expose the data in the text boxes and checkbox's in a manner that would make sense to an outside consumer, like your main form, using public properties and/or events. You do NOT expose the constituent controls outside of the User Control.
|
|
|
|
|
Ah, thanks much for pointing me in the right direction. I've messed around a bit with the code and it looks like everything is working fine.
However I've got one more question. You said the UI was confusing. How so? As this projects wears on I hope to have a list of questions and such about the program or possible revisions.
|
|
|
|
|
XaviousWolffe wrote: You said the UI was confusing. How so?
How you noticed all the checkbox's you've splattered all over the screen?? Wouldn't be better to setup a drag'n'drop solution to move the values to the appropriate attributes??
|
|
|
|
|
How can I write a shell extension with Visual Basic 2005 / 2008 Express? Any help would be most appreciated, but I'm looking for info that would allow me to create extensions to right-click menus in Explorer.
Also, how can I write a VB application that allows plugins or extensions, much like Paint.NET?
Thanks for any help!
drummerboy0511
|
|
|
|
|
You can do it with VB.NET or C#, but with great difficulty. There is a ton of COM interop you have to setup in your code and a bunch of structures you have to create and marshal properly. On top of that, there's a bit of an issue with using managed code to write Shell extensions. You can read about that here[^]. It amy force you to write this in C++ instead.
Beyond that, try these[^] examples. Most of which is going to be C#, but can be converted to VB.NET with a little work.
|
|
|
|
|
Hi,
Actually I want to Communicate the DMM through the computer Comport. So I have created one MSComm control and did following setting and code.
Private Sub Form_Load()
MSComm1.Settings="9600,N,8,1"
MSComm1.CommPort=2
MSComm1.InputLen=0
MSComm1.PortOpen=True
MSComm1.Rthreshold =1
End Sub
I have send the *RST command to reset the DMM by the following code
Private Sub CmdSend_Click()
MSComm1.Output = "*RST"+Chr$(13)
End Sub
When I run this program, The DMM showing errors as -101, -102, -103. All these error are related to characters.
But, When I was running in Hyper terminal mode, DMM communication was perfect. Moreover, the DMM RS-232 setting (Baudrate and all) same as our computer setting. Still I could not communicating with DMM.
Pls help me to found out solution.
|
|
|
|
|
Well, somewhere, you've got at least one of the communication parameters wrong. It would be parity, handshaking, ..., any of them.
BTW, what's a "DMM"?
And if you're using Visual Studio 2005 or above, why are you using the old MsComm control instead of the SerialPort class in the .NET Framework?
|
|
|
|
|
Hi Dave,
the only DMM I know would be a Digital MultiMeter, an electronic device measuring voltages, currents, impedances, and the like. Handheld DMMs normally don't have a computer interface, desktop models often do, either a serial one or more often an IEEE-488 one (that is a rather old byte-wide bus for measurement equipment, not to be confused with IEEE-1394 aka FireWire).
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I figured that's what it was, but now-a-days, he could have been talking to a synthesizer or a toaster oven! I always ask just to make sure. You know what they say about "assume", right?
|
|
|
|
|
Dave Kreskowiak wrote: he could have been talking to a synthesizer or a toaster oven
I like a synthesizer with an interface, OTOH I wouldn't connect to a toaster.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: OTOH I wouldn't connect to a toaster.
What?! You don't want to put a webcam in a toaster to get your English muffin's toasted to the perfect golden brown every time?
|
|
|
|
|
If the toaster contains a camera, that is OK, but I am not interested in those pictures. I want it to be smart enough to deliver on its promises all by itself. That is what embedded systems are supposed to do, not bother me, just deliver the results.
Now if the manufacturer needs an interface to service the device, he can do so; but again, I'm not interested in it. Oh wait, I might want to include it in my next domotica infrastructure. Have to rethink. If so, it won't be a serial port I'm afraid.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,
some guessing is required here.
your DMM probably wants some hardware handshaking (=data flow control), i.e. it needs you to set some control lines high or low, before it wants to listen to you (that would not explain the error conditions you mentioned);
or it wants you to not send stuff when it is not ready, as indicated by some control lines it is setting high or low.
I don't remember how handshaking and control lines work in Win32 or VB6; I do know for .NET
FYI: HyperTerminal by default chooses Hardware Handshake, Win32 does not. So try setting your COM port to hardware handshake.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
HI,
I AM POSTING SOME KB OF XML CONTENT TO WEBSERVER USING XMLHTTP. IT IS WORKING IN MY SYSTEM, IT IS SENDING AND RECEIVING DATA PROPERLY. BUT IN ONE OF MY CLIENTS SYSTEM IT IS NOT WORKING PROPERLY AND IT IS GIVING THE ERROR "The connection with the server was terminated abnormally".
IF ANYBODY HAVE AN IDEA PLS HELP US..
THANK YOU,
RISHI
WinCrs
|
|
|
|
|
I CANT HEAR YOU PROPERLY WHEN YOU SHOUT can you maybe talk a bit quieter.
Have you checked the various system/application error logs?
Have you checked the network stats for the dodgy client, is there high error rates?
Its a start.
|
|
|
|
|
thanks in advance
modified 28-Nov-12 4:47am.
|
|
|
|
|
You have to read the documentation on what these methods do (LTrim, Remove, SubString, ...). This is very simple string manipulation, and yes, Remove would be the way to go here.
|
|
|
|
|
Thanks for that reply...
will gothrough and comeback if i find something not working...
|
|
|
|
|
My.Setting.Save() method works and saves what I need it to save. However, when I view the .config file the values in <usersettings>
<appname.my.mysettings> are not the same as those returned by the My.Settings.PropertyName
When you call the Save() method, does it not also save the changes to the config file?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
There should be a folder within C:\Documents and Settings\user\Local Settings\Application Data or C:\Documents and Settings\user\Application Data folder i can't remember exactly where its at but if you browse those two locations, you should see a folder with your program name and in that should be your config file.
Hope that helps.
|
|
|
|
|
Hi,
I tought that defining EnableVisualStyles would give a XP style look to application. However in design time when I define a backcolor for a button, The glossy look of button disappears. In the mean while, I set the one button's backcolor to system.window color, the glossy look of the button disappeard and now I can't give glossy look to button.
The question is how I can make a button look glossy with a defined backcolor.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
In order to do this, you have to override the OnPaint event handler for the button, and do all the painting yourself.
VisualStyles for buttons is whatever the colour is set to in Windows itself.
There are loads of examples in CodeProject and on the Web. Search for something like 'Glass Button Visual Basic' for ideas on how to do it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|