|
Hi. I'm using an embed windows media player in a windows form in vb.net.
The Media Player has the uiMode = none. The Media Player Control has a fixede size of width = 480 and height =320
The videos plays fine, but when i pause a video(with a button of my form) the windows media player change its size without any reason. it happens sometimes when the video starts too. Does Anybody know why this is happening and how can i fix it?.
Please forgive my english. I need help. Any suggestions or article you know about this topic. thanks.
|
|
|
|
|
Hi,
I wrote 1 form and 1 component for my application
- parent form with listBox (which can display the incoming string)
- child component whic is a socket class to receive and send data.
In my program, i create a socket with child component. Then it will receive the incoming data with asynchronous method. When a string is received, i would like to pass it to the parent form, which has a function for string manipulation and display the string finally.
However, I don't know how to do the "child data pass to parent" method.
Do you have any idea for me?
Does Windows From have any API for that?
Thanks.
Ken
|
|
|
|
|
KenKen Wong wrote: Does Windows From have any API for that?
How about raising an event on the child form that the parent form listens to and acts on? All the child form needs to do then is check that there's something listening to the eventhandler and raise the event.
|
|
|
|
|
|
|
You're welcome. Glad to be of help.
|
|
|
|
|
Hi,
I have to print receipts on Thermal Printer. I found a example on net on http://www.taylorsnet.co.uk/Forums/ForumPosts.aspx?Subject=7[^]
But am wondering about the 1st parameter 'A = Text and H-Location (A for text, B for Barcode)
fileWriter.Write("A800, 20, 1, 3, 2, 2, N") ' 1st line
..........
fileWriter.Write("A750, 20, 1, 3, 2, 2, N") ' 2nd line
.........
A for Text is fine. but the H-Location is Y axis right - I assume as (B)V-location is same in both the line; so that should be X-axis.
If H-location is y, axis then why it is decreasing i.e from 800, 750 ..
Can anyone help me with this part. Is their anyway I can see the contents without printing - like saving the outFile or seeing in PrintPreview, etc.
Any help or guidance is highly appreciated.
Thanks & Regards,
|
|
|
|
|
You're using what looks like a File writer already. Just change whatever is being open to a file instead of whatever you're opening for the printer. Then you can send everything to a file instead of the printer.
|
|
|
|
|
Hi Dave,
By just changing to a file, it will give results like :
N
A800, 20, 1, 3, 2, 2, N"Name"
A750, 20, 1, 3, 2, 2, N"Address"
P1
I wanted a way to see the results like we see in Print Preview. Our print lines include g.drawString..., but the resuts are different. That's what I was asking for Thermal Printer. To know the code kindly refer the link provided in main msg from where I have taken.
Do you know anything about H-Location of this issue ?
Thanks & Regards,
|
|
|
|
|
The only way that's going to happen is if you write your own parser for the language the printer understands (implementing all the commands you have documentation for) and render the image in whatever window you want. There is no class in the .NET Framework that will do this for you. There is probably no 3rd party class that will do this either unless the printer you're using and the commands you send to it are one of the standard page description languages, like PostScript, PCL, ...
|
|
|
|
|
This code will only work if you're using a Zebra printer that understands these codes. It's not going to work for every thermal printer in existance.
Your best source of information on the code you send to the printer is the documentation on your printer, not someone elses code.
|
|
|
|
|
As much as i can remember you have a Zebra designer software comes with zebra printer driver CD. You can design your barcode using that software and also you can export that in a text format(ie the way you are printing).
also you have all documents (comes in a folder) how to print the barcode in that CD itself.
I think reading those documents will help you.
|
|
|
|
|
Hi,
In my desktop app developed in VB.NET, I want to send an email.
Private Sub CreateMessage()
Dim from As New MailAddress(fromTxt.Text.Trim, nameTxt.Text.Trim)
Dim toAdd As New MailAddress(toTxt.Text, totitle)
Dim msg As New MailMessage(from, toAdd)
msg.Subject = subjectTxt.Text.Trim
msg.Body = messageTxt.Text.Trim
Dim cc1 As New MailAddress(cc1.Text)
Dim cc2 As New MailAddress(cc2.Text)
msg.CC.Add(cc1)
msg.CC.Add(cc2)
Dim client As New SmtpClient()
Try
client.Send(msg)
ToolStripStatusLabel1.Text = "Message Sent Successfully"
Catch ex As Exception
ToolStripStatusLabel1.Text = "Error Sending Mail"
MessageBox.Show("Error sending mail : " & ex.ToString, "ERROR :: Try Again", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
cc1 = Nothing
cc2 = Nothing
from = Nothing
toAdd = Nothing
msg = Nothing
client = Nothing
End Try
Return
End Sub
Above is the code I use to send email. I have imported System.Net.Mail & set MailMessage object properly also created SmtpClient. But I don't know what and how to set the Smtp host. I mean, the app will be on differnet PC's & all will be using different means of Internet access. Then how can I know and set the host before sending message. I tried adding "localhost" but that didn't worked. What to do and how to achieve the goal ?
This should be possible and in a simpler manner - when I can do the same in my Java apps then why not in .NET apps. Searched a lot on net also, but every example showed "<your server="" name="">", but how can I know the server name of each PC ???
Any help guidance is highly appreciated.
Thanks & Regards,
|
|
|
|
|
|
Oh Thanks Dave for this.
Just wanted to confirm a point and make myself understand properly.
So a mail will have From & To. From will be someone who is writing & To will be my mail address (I will receive it). If my mail address i.e. To is of hotmail, then I got to implement of Live Mail, if of Yahoo then of Yahoo & if of gmail then of gmail. Then regardless of what the From address belong. If To is "...@hotmail.com" & From is "...@xyz.com" ; If I implement of Live Mail, then I will receive all mails send from anyone.
Am I correct or wrong at any angle. Kindly let me know.
Thanks & Regards,
|
|
|
|
|
From Address is the person sending, To address is the receiver, in this case you.
The SMTP server needs to be any server for which the user who is sending the email is authorised to use. It doesn't matter who the target (TO) address is, it is dependant on who the sender is.
SMTP servers generally need to be authorised, as there are very few open relays now due to the abundance of spam and abuse they receive.
|
|
|
|
|
Thanks Dave, I found my way and also solved the confussion.
But am just wondering 1 thing. In my form I already have ToolStripProgressBar. When the Send(mail) is being executed, for a short while I see 2 progress bars. Then 1 disappears. Can't find what is going on. Does Send() shows a progress bar by default - didn't find any such info in MSDN.
Can you tell what must be the reason of seeing 2 progress bar for a short while when Smtp.Send(mailMessage) function is being executed.
In MSDN I also found that when send is eecutes, it blocks so its safe to set timeout. Can you tell what value should be set in timeout - 100000 (100 secs) is good enough or should be more !
Thanks a lot.
Thanks & Regards,
|
|
|
|
|
Thats good to here.
your welcome.
|
|
|
|
|
When I run my application I am initializing some boolean flags - all of them are set to false at the begining, then just before the Load function ends - I am enabling another windows form full of buttons which are meant to be changing the flag statuses depending on which button the user presses. So when user presses the button on the second form - it run the function which is supossed to change flag status on the first form and after that it closses second form.
The thing is, that the flag status is not being changed, so if I want to set this flag status to true, it's all the time false. I don't know why. Below is the example code:
// declaration of values
private bool isFirstActive;
private bool isSecondActive;
private bool isThirdActive;
//splash screen form
private SplashScreen splashScreen;
//second menu form
private SecondMenu secondForm;
// initialization in constructor
public MainForm()
{
//show the splash screen to the user while loading
splashScreen = new SplashScreen();
splashScreen.Owner = this;
splashScreen.Show();
Application.DoEvents();
this.Enabled = false;
InitializeComponent();
isFirstActive = false;
isSecondActive = false;
isThirdActive = false;
}
private void MainForm_Load(object sender, EventArgs e)
{
//enable the main form
this.Enabled = true;
this.Visible = true;
//close the splash screen
splashScreen.Close();
//enable the second form
secondForm = new FacultyMenu();
secondForm.Owner = this;
secondForm.ShowDialog();
}
So now the user will see second form with some buttons, below the code for the second form with example button click:
private MainForm firstForm;
public SecondMenu()
{
firstForm = new MainForm();
InitializeComponent();
}
private void btnChangeSecond_Click(object sender, EventArgs e)
{
firstForm.changeSecondFlag();
Close();
}
So when user press the button, it will call the following method on the first form:
public void changeSecond()
{
isFirstActive = false;
isSecondActive = true;
isThirdActive = false;
}
Then it's closing the second form and goes back to the main form. but the isSecondActive valuse is still false.
Why?
|
|
|
|
|
acont wrote: So when user press the button, it will call the following method on the first form:
No, it will call a method on an object that has the class-type as defined for the class "MainForm". There's two of those objects; one that's your actual mainform, and that you use to open the second form, and then there's a new object of the same type, created in the SecondMenu method.
acont wrote: Then it's closing the second form and goes back to the main form. but the isSecondActive valuse is still false.
It's closing the second form, and the mainform contained therein (in the private variable firstForm). Then it goes back to the original mainform. The boolean is set in the second instance, the original object isn't changed.
How about passing a reference to your mainform in the constructor of the second form? You could cache a reference to that instance, changing things on that would correctly change the original object.
I are Troll
|
|
|
|
|
forget about this forum to get any help; its useless
|
|
|
|
|
|
imak wrote: Its not a repost
Then add the extra information to your original question, do not delete it and start a new thread.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote:
Then add the extra information to your original question, do not delete it and start a new thread.
just read the information provided to get that extra info
|
|
|
|
|
No your asking us to do your work for you.
D@nish gave you a perfectly valid answer: it is possible.
You can't expect people here to just write the code for you, we all donate our time for free here. If you want somebody else to write your program then go and hire yourself a programmer and pay him.
If you want our help you'll have to proof to us that you at the very least tried to do it yourself (so post you code and where your stuck or have an error).
|
|
|
|
|