|
Hi Mycroft,
Yes, I agree with your crystal reports idea!!!! - it definitely is too much for this project. Yes, the data requirements are minimal and yes, I'm not using a database - I put records into a datagrid view and then serialize when finished.
I'm using using VS 2008 full version.
Could you point me in the direction of any articles/help/other threads/sites on this subject please
I'm a beginner hobby programmer and know only a little but feel I've made good progress so far..... I've got this vision where it's possible to placce a piece of blank paper onto a form and then drag n drop the various objects onto it, ready for printing but I'm realising that probably isn't possible. (it's a good idea for an expert to design a class like that...!!!!).
So could you give me some pointers in the direction I need to go....?
Regards,
Steve
Thanks for your help and advice!
Steve
|
|
|
|
|
Seems to be plenty of articles[^] here to cover the subject.
|
|
|
|
|
Hi All,
I have a Label and A Picturebox. Picturebox have a image.
Label Backcolor is Transparent.
When i am tring to drag Label in Over of Picturebox. Label Backcolor shows Forms Color.
But i want to get background Image which is in Picture box.
Thanks for help
If you can think then I Can.
|
|
|
|
|
Pick a Panel , set it's backgroundpicture to whatever picture was shown in the PictureBox . Next, drag a label to that panel and set it's backgroundcolor to "Transparent" (webcolor).
There you go, a transparent label
I are Troll
|
|
|
|
|
Thanks Dear,
but my requirement is changing and Draging of Picturebox.
So obviously background will be changed.
So Please give me another idea.
If you can think then I Can.
|
|
|
|
|
Add this to the OnPaint handler of your PictureBox;
public Form1()
{
InitializeComponent();
foreach (Control ctl in this.Controls)
if (ctl is Label)
{
Label lbl = (Label)ctl;
lbl.Visible = false;
}
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
foreach (Control ctl in this.Controls)
if (ctl is Label)
{
Label lbl = (Label)ctl;
e.Graphics.DrawString(
lbl.Text,
lbl.Font,
new SolidBrush(lbl.ForeColor),
lbl.Left - pictureBox1.Left,
lbl.Top - pictureBox1.Top);
}
}
eg_Anubhava wrote: So Please give me another idea.
This hides the labels during runtime, and uses the Paint-handler to write the text onto the forms' canvas
eg_Anubhava wrote: but my requirement is changing and Draging of Picturebox.
The PictureBox itself, or the controls inside it? The Panel that I referred to also has support for drag & drop.
Good luck
"Sometimes glass glitters more than diamonds because it has more to prove"
--Terry Pratchett
|
|
|
|
|
Hello Eddy Vluggen,
Thanks for reply.but
You are trying to create text on picture box.but my concept says show picture in label when i m draging and moving label around picturebox.
If you can think then I Can.
|
|
|
|
|
I'm sorry, but both Label as well as the PictureBox have their limitations. The second solution that I posted removes the Label entirely, and you can't click (or drag) what isn't there.
Unfortunately, I don't know how to achieve the requirements of your concept.
I are Troll
|
|
|
|
|
Hello To All
i am having a hard time here
what i am trying to do it when you check the check box and status is not connected it will display a msg me saying the error messages like Interface is not pluged in
this is my problem i got it to work with the IF but you check the boc get the error boc click on and the check box is checked i dont want it checked if the satus is not connected so i put CheckBox1.Checked = False that worked but now i get the error msgbox 2 times i no why when it taked the check box out it runs the IF code lines agine
Is thare anyway to fix this of some other thing i can google and look up ???
Thanks in advance
Bob
<br />
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged<br />
If Status.Text = "Not Connected" Then<br />
MsgBox("Interface is not pluged in", MsgBoxStyle.OkOnly + vbCritical, "Error")<br />
CheckBox1.Checked = False<br />
<br />
Else<br />
'The Code to Run My Program '<br />
End If<br />
End Sub<br />
|
|
|
|
|
Set a form level flag before you do the check bChecking to true, inside your event code return if the flag = true, this will short circuit the recursive loop. Then the last line (after setting the checkbox) set bChecking to false so it is ready for the next event. Something like the following
Private bool bChecking
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
if bCheckeing then return
bchecking = true
If Status.Text = "Not Connected" Then
MsgBox("Interface is not pluged in", MsgBoxStyle.OkOnly + vbCritical, "Error")
CheckBox1.Checked = False
bchecking = false
Else
'The Code to Run My Program '
End If
End Sub
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks Mycrott
I am pretty sure i got it to work the way i wanted just have to do more testing when i get home tonight
Once agine your help is Greatly appreciated
Thanks
Bob
|
|
|
|
|
Ok i tested it and that part you showd me works perfect now i have a other problem
When click the check box with the device not conectted i get the error msg box and the check do not stay thare that part works good
When click the check box with the device conectted it runs the code
If CheckBox1.Checked Then
NumericUpDown1.Value = CType(CTemp.Text, Integer) + 1
NumericUpDown2.Value = CType(CTemp.Text, Integer) - 1
and it works
But when you click to take the check out of the check box it will not run this code
Else
NumericUpDown1.Value = 0.0
NumericUpDown2.Value = 0.0
phidgetIFK.outputs(0) = False
phidgetIFK.outputs(1) = False
End If
witch it was working before i put the bChecking
Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If bChecking Then Return
bChecking = True
If Status.Text = "Not Connected" Then
MsgBox("interface is not connected. Connect USB cable and try agine.", MsgBoxStyle.OkOnly + vbCritical, "Error")
CheckBox1.Checked = False
bChecking = False
Else
If CheckBox1.Checked Then
NumericUpDown1.Value = CType(CTemp.Text, Integer) + 1
NumericUpDown2.Value = CType(CTemp.Text, Integer) - 1
Else
NumericUpDown1.Value = 0.0
NumericUpDown2.Value = 0.0
phidgetIFK.outputs(0) = False
phidgetIFK.outputs(1) = False
End If
End If
End Sub
Thanks for every ones help
|
|
|
|
|
I need to know how to make buttons and other objects move to the center of the form and possibly grow in size when form is maximized and also move back to its position when minimized. Please I need fast response house
|
|
|
|
|
tolmega01 wrote: Please I need fast response house
That is almost certain to slow any replies. If it is that urgent, get your credit card out and visit rentacoder.com
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.”
|
|
|
|
|
Look into Docking and Anchor properties of your controls.
There are some articles here on CP that may be useful, try searching.
Delay due to speed demand - I mean you really need to read the forum guidelines before posting!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
i have a form where there is a control to load a word document.
for example on button click opendialogue file to select the document and parse it back to the textbox and then save it to the database..mind you it will be in byte..
please give me a code sample to do this.
thanks
|
|
|
|
|
waner michaud wrote: please give me a code sample to do this.
I suggest you read the guidelines on how to ask a question - this request just irritates those who answer.
waner michaud wrote: parse it back to the textbox
Why do you want to do this, you will lose any formatting in the word document. Then you intend to save it back to the database as a binary. Do a search on saving documents to SQL Server. I did this recently and found some excellent examples.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Using VB 2008 Express and MySQL 5.1.36 community server I created a database application whose idea is to keep some data about digital pictures (place taken, description, filepaths for the picture and so on). Works well to suite my needs. Through the app I can also create backupfiles using mysqldump. It is a standalone app. supposed to be used locally. MySQL uses MyIsam not InnoDb.
Via the mysql commandline it is possible to restore the database using the backupfile like this:
"mysql> source C:/dump.sql; " and that also works for a more complex path with more slashes in. It does not work with underscores in the path (or I did not bother to find a solution, I changed the actual paths instead to avoid that problem.)
Via the command line it also works like this:
"mysql> source C:\dump.sql;" however the beep sounds but the restoration takes place. So best use is the forward slashes /// in the first example to avoid the beeping.
The dump file is written to Create Database if not exists and the corresponding drop tables if exists is there. As I said, the dump file works to restore by the commandline.
Through VB then? Not a chance so far. I have read TFM but it doesn't have much to say. Google has been used but without success so far.
Friend Sub RestoreIt()<br />
Dim ArgumentString As String, UserString As String, PasswordString As String <br />
Dim str4Q As String = """"<br />
Dim p1 As New ProcessStartInfo, FilePath As String = App_Path()<br />
FilePath = Replace(FilePath, "\", "/")<br />
Dim DumpFile As String = FilePath & "dump.sql"<br />
UserString = "root"<br />
PasswordString = "blabla"<br />
ArgumentString = " --user=" & UserString & " --password=" & PasswordString & " source " & DumpFile<br />
<br />
Try<br />
With p1<br />
.UseShellExecute = False<br />
.FileName = "C:\Program\MySQL\MySQL Server 5.1\bin\mysql.exe"<br />
.Arguments = ArgumentString<br />
End With<br />
Process.Start(p1)<br />
<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message, _<br />
Me.Text, _<br />
MessageBoxButtons.OK, _<br />
MessageBoxIcon.Error)<br />
End Try<br />
<br />
End Sub<br />
Public Function App_Path() As String<br />
Return System.AppDomain.CurrentDomain.BaseDirectory()<br />
End Function<br />
The process starts but nothing happens. I dont know how to go on. Is it possible to read the process line by line and see where the errors occcurs? It rolls on like an thunderstorm with some lines. Or does someone have an direct answer to solve my problem? Where the dumpfile is located could not be the problem cause it works from the commandline from different locations such as C:/dump and C:/Whatever/Dump/Anotherdump/dump.sql
I tried with and without the """" (as in str4Q) before and after the filevariable but nothing works. Those four quotes is necessary when creating the dumpfile via mysqldump. I have also tried to write a batch file to run instead of the System.Process but no result.
As could be seen in the code I have replaced the back slashes with forward slashes. Tried the opposite and also with double slashes but no result.
Any hints are more than welcome,
leif, sweden
|
|
|
|
|
Finally, a nightly session with Google did it.
Thanks to the signatur "Guid" in the posted link here and his C# solution which was easy adaptable to VB.
http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/def0ec15-45e7-47a0-95ca-c813a8f8072d/[^]
In the above linked forum it also suggests to use a stored procedure within MySQL. Has to be tested...
But this code did it. Two namespaces had to be imported as well as a DLL import of "kernel32.dll".
Directory for batfile must exist. No error handling yet.
Imports System.Runtime.InteropServices<br />
Imports System.Text<br />
Public Class Admin<br />
<br />
<DllImport("kernel32.dll", CharSet:=CharSet.Auto)> Public Shared Function GetShortPathName(ByVal lpszLongPath As String, ByVal lpszShortPath As StringBuilder, ByVal cchBuffer As UInt32) As UInt32<br />
End Function<br />
<br />
Friend Sub DeKomp()<br />
Dim buffer As New StringBuilder(256)<br />
GetShortPathName(Path.GetDirectoryName("C:\Program\MySQL\MySQL Server 5.1\bin\mysql.exe"), buffer, buffer.Capacity)<br />
Dim shortfilename As String = buffer.ToString<br />
Dim batchfile As String = "c:\XBatch.bat"<br />
Dim sw As New StreamWriter("c:\XBatch.bat")<br />
sw.WriteLine("cd " + shortfilename)<br />
sw.WriteLine("mysql -uroot -pXXXX testbDB< C:/VB9/MyBkUps/Data/dump.sql")<br />
sw.Flush()<br />
sw.Close()<br />
Environment.CurrentDirectory = "c:\windows\"<br />
Process.Start(batchfile)<br />
End Sub<br />
End Class
|
|
|
|
|
Hi All,
I am Coping data from System Drive and i m tring to Paste in Removeable media.
So i want to get the Source path of file which is paste in Removable media.
Thanks
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: I am Coping data from System Drive and i m tring to Paste in Removeable media.
So i want to get the Source path of file which is paste in Removable media.
From where do you copy paste, and what do you acctualy want to do? I don't understand a thing.
Didi
|
|
|
|
|
When i am trying to Paste information from my clipboard at this time i want to know that what is the location where from data is Coping ?
If you can think then I Can.
|
|
|
|
|
0) What have you tried? (we don't just give you the entire program you know)
1) Please explain a little bit better.
1.1) is there a user interface (I'm guessing yes)?
1.2) are you using a openfiledialog to determine your original file or not?
1.3) are you using a savefiledailog to determine the destination or not?
2) look at the following namespaces:
2.1) system.io.file
2.2) system.io.path
2.3) system.io.directory
3) Your really going to have to explain your question better and post what you have try'd so far.
|
|
|
|
|
I have a USB drive which i want to monitor.At this time when i am copy the data and Paste in USB Drive i want to know the main source of coping data.
I want to know the main source of data where from it copied.
if u have any solution or idea please help.
Thanks
If you can think then I Can.
|
|
|
|
|
Unless your program is doing the copying I don't think you can find the original path of the data.
|
|
|
|